llvm-project
llvm-project copied to clipboard
[LifetimeSafety] Use canonical declaration for lifetimebound annotation suggestions
After #197753 landed, we now have a more precise API to get the declaration we should warn about.
Let's also warn on the declaration returned by getCanonicalDeclForAttr when it differs from the declaration returned by getCrossTUDecl. This covers cases where the canonical declaration and the declaration visible from other translation units are not the same.
@llvm/issue-subscribers-clang-temporal-safety
Author: NeKon69
After #197753 landed, we now have a more precise API to get the declaration we should warn about.
Let's replace the usages of getCrossTUDecl in the annotation suggestion path with getCanonicalDeclForAttr.