Can a Kohen Go to a Tzaddik’s Funeral?

The great Rishon Rabbeinu Chaim HaKohen once remarked that had he already been born when Rabbeinu Tam passed away, he would have become tamei and gone to his funeral. (Kesubos 103b, Tosfos D”H Oso) Granted, Rabbeinu Tam was a great tzaddik and talmid chacham, but Rabbeinu Chaim HaKohen was, in fact, a kohen. How could he come in close proximity to a meis? Kohanim are enjoined against becoming tamei even nowadays.
Apparently, Rabbeinu Chaim HaKohen felt that since Rabbeinu Tam was the greatest sage of his generation, kohanim could attend his funeral. Still, the exact reasoning needs explanation.
As an aside, it is interesting to note that Rabbeinu Tam’s piety is universally recognized by his very name. Most Rishonim are referred to by their first name with the honorific Rabbeinu appended to it. Other Rishonim are known by their acronyms. Rabbeinu Yaakov, on the other hand, is referred to as Rabbeinu Tam. The Torah describes Yaakov Avinu as “Ish tam,” and that title was applied by the populace to Rabbeinu Yaakov, who for generations has been called Rabbeinu Tam.