llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[LifetimeSafety] Use canonical declaration for lifetimebound annotation suggestions

Open NeKon69 opened this issue 6 months ago • 1 comments

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.

NeKon69 avatar May 19 '26 19:05 NeKon69

@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.