================
@@ -1222,7 +1221,19 @@ static void handlePreferredName(Sema &S, Decl *D, const 
ParsedAttr &AL) {
     }
 
     if (Template && declaresSameEntity(Template, CTD)) {
-      D->addAttr(::new (S.Context) PreferredNameAttr(S.Context, AL, TSI));
+      auto *PNA = ::new (S.Context) PreferredNameAttr(S.Context, AL, TSI);
+      D->addAttr(PNA);
+
+      for (auto *Spec : CTD->specializations()) {
+        const TypeDecl *TD = static_cast<const TypeDecl *>(Spec);
+        if (S.Context.hasSameType(S.Context.getTypeDeclType(TD),
----------------
zyn0217 wrote:

What makes it necessary to check the same type here?

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

Reply via email to