================
@@ -19493,7 +19493,11 @@ void Sema::ActOnFields(Scope *S, SourceLocation 
RecLoc, Decl *EnclosingDecl,
       CDecl->setIvarRBraceLoc(RBrac);
     }
   }
-  ProcessAPINotes(Record);
+
+  // If this is a class template instantiation, its API Notes attributes were
+  // added to the class template itself. Make sure they are not added twice.
+  if (!CXXRecord || !CXXRecord->getDescribedClassTemplate())
----------------
Xazax-hun wrote:

I am a bit confused. 
The PR description says:
>  don't try to add attributes from API Notes to concrete instantiations
 I'd expect this code to do the opposite. I'd expect 
`getDescribedClassTemplate` to return null for instantiations, so I'd expect us 
to take this branch when we process an instantiation. 

https://github.com/llvm/llvm-project/pull/122516
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to