diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index ca71542d886fa..4691da69de155 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -2119,7 +2119,6 @@ DeclResult Sema::CheckClassTemplate( NewClass->startDefinition(); ProcessDeclAttributeList(S, NewClass, Attr); - ProcessAPINotes(NewClass); if (PrevClassTemplate) mergeDeclAttributes(NewClass, PrevClassTemplate->getTemplatedDecl()); diff --git a/clang/test/APINotes/Inputs/Headers/Templates.h b/clang/test/APINotes/Inputs/Headers/Templates.h index 862035fee363f..2a86a46d4af27 100644 --- a/clang/test/APINotes/Inputs/Headers/Templates.h +++ b/clang/test/APINotes/Inputs/Headers/Templates.h @@ -6,4 +6,5 @@ struct Box { const T* get_ptr() const { return &value; } }; +using FloatBox = Box; using IntBox = Box; diff --git a/clang/test/APINotes/templates.cpp b/clang/test/APINotes/templates.cpp index 0556eba925a51..48109011e73a9 100644 --- a/clang/test/APINotes/templates.cpp +++ b/clang/test/APINotes/templates.cpp @@ -7,3 +7,6 @@ // CHECK-BOX: Dumping Box: // CHECK-BOX-NEXT: ClassTemplateDecl {{.+}} imported in Templates Box // CHECK-BOX: SwiftAttrAttr {{.+}} <> "import_owned" + +// Make sure the attributes aren't duplicated. +// CHECK-BOX-NOT: SwiftAttrAttr {{.+}} <> "import_owned"