================
@@ -160,11 +161,35 @@ class LifetimeChecker {
}
}
+ /// Returns the declaration of a function that is visible across translation
+ /// units, if such a declaration exists and is different from the definition.
+ static const FunctionDecl *getCrossTUDecl(const ParmVarDecl &PVD,
----------------
Xazax-hun wrote:
I think this probably works for the most cases but is incomplete in general.
The canonical declaration is the first declaration that appears in the
translation unit. One could do something like:
```
void f();
#include "header_of_f.h"
void f() {}
```
So it is possible, that the canonical declaration is not the one that is in a
public header. I expect this to be very rare but a complete solution might
require us to walk the entire redeclaration chain.
https://github.com/llvm/llvm-project/pull/171972
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits