[PATCH] D153003: [ODRHash] Fix ODR hashing of template names

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 16 01:29:31 PDT 2023


Hahnfeld added a comment.

> For example, the template name with QualifiedTemplate kind has different hash name with the name with DependentTemplate kind. But it is not true after the patch.

Yes, I do understand. However, what I'm asking is why we need to differentiate between the two, ie in which cases do we want these two to have a different hash?

> No. IsSameEntity is a weaker check. It simply checks whether two named decls refers to the same name.

I'm confused: Hashing always works the way that two "identical" objects hash to the same value, while two "non-identical" objects may also hash to the same value (hash collision). The way I understand your statement is that two "identical" Decls, including `isSame` returning `true`, can have a different hashes. This doesn't make sense to me, could you maybe clarify?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153003/new/

https://reviews.llvm.org/D153003



More information about the cfe-commits mailing list