================
@@ -8804,6 +8804,31 @@ NamedDecl *Sema::DeclClonePragmaWeak(NamedDecl *ND, 
const IdentifierInfo *II,
 void Sema::DeclApplyPragmaWeak(Scope *S, NamedDecl *ND, const WeakInfo &W) {
   if (W.getAlias()) { // clone decl, impersonate __attribute(weak,alias(...))
     IdentifierInfo *NDId = ND->getIdentifier();
+
+    // Append attribute on previous declaration only.
+    NamedDecl *Prev = LookupSingleName(TUScope, W.getAlias(), W.getLocation(),
----------------
efriedma-quic wrote:

What's the relationship between Prev and ND?

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

Reply via email to