================
@@ -279,6 +306,8 @@ CrossTranslationUnitContext::~CrossTranslationUnitContext() 
{}
 std::optional<std::string>
 CrossTranslationUnitContext::getLookupName(const Decl *D) {
   SmallString<128> DeclUSR;
+  if (D->hasAttr<WeakAttr>())
+    DeclUSR.push_back('-');
----------------
balazske wrote:

It is a difficult question if it is correct to have a different USR for weak 
and non-weak version of the "same" declaration. One program should have 
theoretically not multiple versions of a declaration but with the "weak" 
attribute this is possible, so it may have a different USR. This needs more 
discussion because changes in the USR generation can affect other areas and use 
cases. If the weak attribute was not a problem before (except this CTU use 
case) probably it is not worth such a big change.

https://github.com/llvm/llvm-project/pull/204188
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to