
If a C++ class template is annotated via API Notes, the instantiations had the attributes repeated twice. This is because Clang was adding the attribute twice while processing the same class template. This change makes sure we don't try to add attributes from API Notes twice. There is currently no way to annotate specific instantiations using API Notes. rdar://142539959
13 lines
823 B
C++
13 lines
823 B
C++
// RUN: rm -rf %t && mkdir -p %t
|
|
// RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Tmpl -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -x c++
|
|
// RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Tmpl -fdisable-module-hash -fapinotes-modules -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Box -x c++ | FileCheck -check-prefix=CHECK-BOX %s
|
|
|
|
#include "Templates.h"
|
|
|
|
// CHECK-BOX: Dumping Box:
|
|
// CHECK-BOX-NEXT: ClassTemplateDecl {{.+}} imported in Templates Box
|
|
// CHECK-BOX: SwiftAttrAttr {{.+}} <<invalid sloc>> "import_owned"
|
|
|
|
// Make sure the attributes aren't duplicated.
|
|
// CHECK-BOX-NOT: SwiftAttrAttr {{.+}} <<invalid sloc>> "import_owned"
|