Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -127,6 +127,13 @@ ``std::move, std::forward`` et al. it is now treated as a compiler builtin and implemented directly rather than instantiating the definition from the standard library. +- Clang no longer claims to support the ``[[carries_dependency]]`` attribute. + We have not implemented any semantics for this attribute in the past decade, + have no plans to implement any in the future, and so returning nonzero from + ``__has_cpp_attribute`` was a disservice. The attribute is now treated as an + unknown attribute and ``__has_cpp_attribute(carries_dependency)`` now returns + zero. + C++20 Feature Support ^^^^^^^^^^^^^^^^^^^^^ Index: clang/include/clang/Basic/Attr.td =================================================================== --- clang/include/clang/Basic/Attr.td +++ clang/include/clang/Basic/Attr.td @@ -978,13 +978,6 @@ let Spellings = [GNU<"bounded">]; } -def CarriesDependency : InheritableParamAttr { - let Spellings = [GNU<"carries_dependency">, - CXX11<"","carries_dependency", 200809>]; - let Subjects = SubjectList<[ParmVar, ObjCMethod, Function], ErrorDiag>; - let Documentation = [CarriesDependencyDocs]; -} - def CDecl : DeclOrTypeAttr { let Spellings = [GCC<"cdecl">, Keyword<"__cdecl">, Keyword<"_cdecl">]; // let Subjects = [Function, ObjCMethod]; Index: clang/include/clang/Basic/AttrDocs.td =================================================================== --- clang/include/clang/Basic/AttrDocs.td +++ clang/include/clang/Basic/AttrDocs.td @@ -283,23 +283,6 @@ }]; } -def CarriesDependencyDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -The ``carries_dependency`` attribute specifies dependency propagation into and -out of functions. - -When specified on a function or Objective-C method, the ``carries_dependency`` -attribute means that the return value carries a dependency out of the function, -so that the implementation need not constrain ordering upon return from that -function. Implementations of the function and its caller may choose to preserve -dependencies instead of emitting memory ordering instructions such as fences. - -Note, this attribute does not change the meaning of the program, but may result -in generation of more efficient code. - }]; -} - def CPUSpecificCPUDispatchDocs : Documentation { let Category = DocCatFunction; let Content = [{ Index: clang/lib/Parse/ParseDeclCXX.cpp =================================================================== --- clang/lib/Parse/ParseDeclCXX.cpp +++ clang/lib/Parse/ParseDeclCXX.cpp @@ -4320,7 +4320,6 @@ IdentifierInfo *ScopeName) { switch ( ParsedAttr::getParsedKind(AttrName, ScopeName, ParsedAttr::AS_CXX11)) { - case ParsedAttr::AT_CarriesDependency: case ParsedAttr::AT_Deprecated: case ParsedAttr::AT_FallThrough: case ParsedAttr::AT_CXX11NoReturn: Index: clang/lib/Sema/SemaDecl.cpp =================================================================== --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -3317,24 +3317,6 @@ static void mergeParamDeclAttributes(ParmVarDecl *newDecl, const ParmVarDecl *oldDecl, Sema &S) { - // C++11 [dcl.attr.depend]p2: - // The first declaration of a function shall specify the - // carries_dependency attribute for its declarator-id if any declaration - // of the function specifies the carries_dependency attribute. - const CarriesDependencyAttr *CDA = newDecl->getAttr(); - if (CDA && !oldDecl->hasAttr()) { - S.Diag(CDA->getLocation(), - diag::err_carries_dependency_missing_on_first_decl) << 1/*Param*/; - // Find the first declaration of the parameter. - // FIXME: Should we build redeclaration chains for function parameters? - const FunctionDecl *FirstFD = - cast(oldDecl->getDeclContext())->getFirstDecl(); - const ParmVarDecl *FirstVD = - FirstFD->getParamDecl(oldDecl->getFunctionScopeIndex()); - S.Diag(FirstVD->getLocation(), - diag::note_carries_dependency_missing_first_decl) << 1/*Param*/; - } - if (!oldDecl->hasAttrs()) return; @@ -4031,18 +4013,6 @@ Diag(Old->getLocation(), diag::note_previous_declaration); } - // C++11 [dcl.attr.depend]p2: - // The first declaration of a function shall specify the - // carries_dependency attribute for its declarator-id if any declaration - // of the function specifies the carries_dependency attribute. - const CarriesDependencyAttr *CDA = New->getAttr(); - if (CDA && !Old->hasAttr()) { - Diag(CDA->getLocation(), - diag::err_carries_dependency_missing_on_first_decl) << 0/*Function*/; - Diag(Old->getFirstDecl()->getLocation(), - diag::note_carries_dependency_missing_first_decl) << 0/*Function*/; - } - // (C++98 8.3.5p3): // All declarations for a function shall agree exactly in both the // return type and the parameter-type-list. Index: clang/lib/Sema/SemaDeclAttr.cpp =================================================================== --- clang/lib/Sema/SemaDeclAttr.cpp +++ clang/lib/Sema/SemaDeclAttr.cpp @@ -2301,21 +2301,6 @@ D->addAttr(::new (S.Context) VecReturnAttr(S.Context, AL)); } -static void handleDependencyAttr(Sema &S, Scope *Scope, Decl *D, - const ParsedAttr &AL) { - if (isa(D)) { - // [[carries_dependency]] can only be applied to a parameter if it is a - // parameter of a function declaration or lambda. - if (!(Scope->getFlags() & clang::Scope::FunctionDeclarationScope)) { - S.Diag(AL.getLoc(), - diag::err_carries_dependency_param_not_function_decl); - return; - } - } - - D->addAttr(::new (S.Context) CarriesDependencyAttr(S.Context, AL)); -} - static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { bool IsCXX17Attr = AL.isCXX11Attribute() && !AL.getScopeName(); @@ -8775,9 +8760,6 @@ case ParsedAttr::AT_Availability: handleAvailabilityAttr(S, D, AL); break; - case ParsedAttr::AT_CarriesDependency: - handleDependencyAttr(S, scope, D, AL); - break; case ParsedAttr::AT_CPUDispatch: case ParsedAttr::AT_CPUSpecific: handleCPUSpecificAttr(S, D, AL); Index: clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.depend/p1.cpp =================================================================== --- clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.depend/p1.cpp +++ clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.depend/p1.cpp @@ -1,32 +1,9 @@ // RUN: %clang_cc1 -verify -std=c++11 %s +// expected-no-diagnostics -[[carries_dependency, carries_dependency]] int m1(); // ok -[[carries_dependency]] [[carries_dependency]] int m2(); // ok -[[carries_dependency()]] int m3(); // expected-error {{attribute 'carries_dependency' cannot have an argument list}} - -[[carries_dependency]] void f1(); // FIXME: warn here -[[carries_dependency]] int f2(); // ok -int f3(int param [[carries_dependency]]); // ok -[[carries_dependency]] int (*f4)(); // expected-error {{'carries_dependency' attribute only applies to parameters, Objective-C methods, and functions}} -int (*f5 [[carries_dependency]])(); // expected-error {{'carries_dependency' attribute only applies to}} -int (*f6)() [[carries_dependency]]; // expected-error {{'carries_dependency' attribute cannot be applied to types}} -int (*f7)(int n [[carries_dependency]]); // expected-error {{'[[carries_dependency]]' attribute only allowed on parameter in a function declaration}} -int (((f8)))(int n [[carries_dependency]]); // ok -int (*f9(int n))(int n [[carries_dependency]]); // expected-error {{'[[carries_dependency]]' attribute only allowed on parameter in a function declaration}} -int typedef f10(int n [[carries_dependency]]); // expected-error {{'[[carries_dependency]]' attribute only allowed on parameter in a function declaration}} -using T = int(int n [[carries_dependency]]); // expected-error {{'[[carries_dependency]]' attribute only allowed on parameter in a function declaration}} -struct S { - [[carries_dependency]] int f(int n [[carries_dependency]]); // ok - int (*p)(int n [[carries_dependency]]); // expected-error {{'[[carries_dependency]]' attribute only allowed on parameter in a function declaration}} -}; -void f() { - [[carries_dependency]] int f(int n [[carries_dependency]]); // ok - [[carries_dependency]] // expected-error {{'carries_dependency' attribute only applies to}} - int (*p)(int n [[carries_dependency]]); // expected-error {{'[[carries_dependency]]' attribute only allowed on parameter in a function declaration}} -} - -auto l1 = [](int n [[carries_dependency]]) {}; -// There's no way to write a lambda such that the return value carries -// a dependency, because an attribute applied to the lambda appertains to -// the *type* of the operator() function, not to the function itself. -auto l2 = []() [[carries_dependency]] {}; // expected-error {{'carries_dependency' attribute cannot be applied to types}} +// We do not do anything with [[carries_dependency]], so we do not +// claim to support it. We ignore it as we would any other unknown +// attribute. +#if __has_cpp_attribute(carries_dependency) +#error "Did not expect to support carries_dependency" +#endif Index: clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.depend/p2.cpp =================================================================== --- clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.depend/p2.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// RUN: %clang_cc1 -verify -std=c++11 %s - -int f(int); // expected-note 2{{declaration missing '[[carries_dependency]]' attribute is here}} -[[carries_dependency]] int f(int); // expected-error {{function declared '[[carries_dependency]]' after its first declaration}} -int f(int n [[carries_dependency]]); // expected-error {{parameter declared '[[carries_dependency]]' after its first declaration}} - -int g([[carries_dependency]] int n); // expected-note {{declaration missing '[[carries_dependency]]' attribute is here}} -int g(int); -[[carries_dependency]] int g(int); // expected-error {{function declared '[[carries_dependency]]' after its first declaration}} -int g(int n [[carries_dependency]]); - -int h [[carries_dependency]](); -int h(); -[[carries_dependency]] int h(); Index: clang/test/CodeCompletion/attr.cpp =================================================================== --- clang/test/CodeCompletion/attr.cpp +++ clang/test/CodeCompletion/attr.cpp @@ -1,12 +1,10 @@ int a [[gnu::used]]; // RUN: %clang_cc1 -code-completion-at=%s:%(line-1):9 %s | FileCheck --check-prefix=STD %s -// STD: COMPLETION: Pattern : __carries_dependency__ // STD-NOT: COMPLETION: Pattern : __convergent__ // STD: COMPLETION: Pattern : __gnu__::__used__ // STD-NOT: COMPLETION: Pattern : __gnu__::used // STD-NOT: COMPLETION: Pattern : __used__ // STD: COMPLETION: Pattern : _Clang::__convergent__ -// STD: COMPLETION: Pattern : carries_dependency // STD-NOT: COMPLETION: Pattern : clang::called_once // STD: COMPLETION: Pattern : clang::convergent // STD-NOT: COMPLETION: Pattern : convergent @@ -15,11 +13,10 @@ // STD: COMPLETION: Pattern : gnu::alias(<#Aliasee#>) // STD: COMPLETION: Pattern : gnu::used // STD-NOT: COMPLETION: Pattern : used -// RUN: %clang_cc1 -code-completion-at=%s:%(line-17):9 -xobjective-c++ %s | FileCheck --check-prefix=STD-OBJC %s +// RUN: %clang_cc1 -code-completion-at=%s:%(line-15):9 -xobjective-c++ %s | FileCheck --check-prefix=STD-OBJC %s // STD-OBJC: COMPLETION: Pattern : clang::called_once -// RUN: %clang_cc1 -code-completion-at=%s:%(line-19):14 %s | FileCheck --check-prefix=STD-NS %s +// RUN: %clang_cc1 -code-completion-at=%s:%(line-17):14 %s | FileCheck --check-prefix=STD-NS %s // STD-NS-NOT: COMPLETION: Pattern : __used__ -// STD-NS-NOT: COMPLETION: Pattern : carries_dependency // STD-NS-NOT: COMPLETION: Pattern : clang::convergent // STD-NS-NOT: COMPLETION: Pattern : convergent // STD-NS-NOT: COMPLETION: Pattern : gnu::used @@ -33,7 +30,6 @@ // RUN: %clang_cc1 -code-completion-at=%s:%(line-1):15 %s | FileCheck --check-prefix=STD-USING %s // STD-USING: COMPLETION: __gnu__ // STD-USING: COMPLETION: _Clang -// STD-USING-NOT: COMPLETION: Pattern : carries_dependency // STD-USING: COMPLETION: clang // STD-USING-NOT: COMPLETION: Pattern : clang:: // STD-USING-NOT: COMPLETION: Pattern : gnu:: @@ -42,12 +38,10 @@ int d __attribute__((used)); // RUN: %clang_cc1 -code-completion-at=%s:%(line-1):22 %s | FileCheck --check-prefix=GNU %s -// GNU: COMPLETION: Pattern : __carries_dependency__ // GNU: COMPLETION: Pattern : __convergent__ // GNU-NOT: COMPLETION: Pattern : __gnu__::__used__ // GNU: COMPLETION: Pattern : __used__ // GNU-NOT: COMPLETION: Pattern : _Clang::__convergent__ -// GNU: COMPLETION: Pattern : carries_dependency // GNU-NOT: COMPLETION: Pattern : clang::convergent // GNU: COMPLETION: Pattern : convergent // GNU-NOT: COMPLETION: Pattern : gnu::used Index: clang/test/Misc/pragma-attribute-supported-attributes-list.test =================================================================== --- clang/test/Misc/pragma-attribute-supported-attributes-list.test +++ clang/test/Misc/pragma-attribute-supported-attributes-list.test @@ -44,7 +44,6 @@ // CHECK-NEXT: Callback (SubjectMatchRule_function) // CHECK-NEXT: CalledOnce (SubjectMatchRule_variable_is_parameter) // CHECK-NEXT: Capability (SubjectMatchRule_record, SubjectMatchRule_type_alias) -// CHECK-NEXT: CarriesDependency (SubjectMatchRule_variable_is_parameter, SubjectMatchRule_objc_method, SubjectMatchRule_function) // CHECK-NEXT: Cleanup (SubjectMatchRule_variable_is_local) // CHECK-NEXT: CmseNSEntry (SubjectMatchRule_function) // CHECK-NEXT: Cold (SubjectMatchRule_function) Index: clang/test/Parser/cxx0x-attributes.cpp =================================================================== --- clang/test/Parser/cxx0x-attributes.cpp +++ clang/test/Parser/cxx0x-attributes.cpp @@ -330,7 +330,7 @@ expected-error {{an attribute list cannot appear here}} typedef [[gnu::used]] unsigned long [[gnu::unused]] v2; // expected-error {{'unused' attribute cannot be applied to types}} \ expected-error {{an attribute list cannot appear here}} -int [[carries_dependency]] foo(int [[carries_dependency]] x); // expected-error 2{{'carries_dependency' attribute cannot be applied to types}} +int [[carries_dependency]] foo(int [[carries_dependency]] x); // expected-warning 2{{unknown attribute 'carries_dependency' ignored}} // Forbid [[gnu::...]] attributes on declarator chunks. int *[[gnu::unused]] v3; // expected-warning {{attribute 'unused' ignored}} @@ -339,7 +339,7 @@ [[attribute_declaration]]; // expected-warning {{unknown attribute 'attribute_declaration' ignored}} [[noreturn]]; // expected-error {{'noreturn' attribute only applies to functions}} -[[carries_dependency]]; // expected-error {{'carries_dependency' attribute only applies to parameters, Objective-C methods, and functions}} +[[carries_dependency]]; // expected-warning {{unknown attribute 'carries_dependency' ignored}} class A { A([[gnu::unused]] int a); Index: clang/test/Parser/cxx11-stmt-attributes.cpp =================================================================== --- clang/test/Parser/cxx11-stmt-attributes.cpp +++ clang/test/Parser/cxx11-stmt-attributes.cpp @@ -25,7 +25,7 @@ } [[unknown_attribute]] return; // expected-warning {{unknown attribute 'unknown_attribute' ignored}} - + alignas(8) ; // expected-error {{'alignas' attribute cannot be applied to a statement}} [[noreturn]] { } // expected-error {{'noreturn' attribute cannot be applied to a statement}} @@ -42,7 +42,7 @@ [[unused]] switch (i) { // expected-warning {{unknown attribute 'unused' ignored}} [[uuid]] case 0: // expected-warning {{unknown attribute 'uuid' ignored}} [[visibility]] default: // expected-warning {{unknown attribute 'visibility' ignored}} - [[carries_dependency]] break; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} + [[gnu::nonnull]] break; // expected-error {{'nonnull' attribute cannot be applied to a statement}} } [[fastcall]] goto there; // expected-warning {{unknown attribute 'fastcall' ignored}} @@ -54,28 +54,28 @@ [[weakref]] return; // expected-warning {{unknown attribute 'weakref' ignored}} - [[carries_dependency]] ; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - [[carries_dependency]] { } // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - [[carries_dependency]] if (0) { } // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - [[carries_dependency]] for (;;); // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - [[carries_dependency]] do { // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - [[carries_dependency]] continue; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} ignored}} + [[gnu::nonnull]] ; // expected-error {{'nonnull' attribute cannot be applied to a statement}} + [[gnu::nonnull]] { } // expected-error {{'nonnull' attribute cannot be applied to a statement}} + [[gnu::nonnull]] if (0) { } // expected-error {{'nonnull' attribute cannot be applied to a statement}} + [[gnu::nonnull]] for (;;); // expected-error {{'nonnull' attribute cannot be applied to a statement}} + [[gnu::nonnull]] do { // expected-error {{'nonnull' attribute cannot be applied to a statement}} + [[gnu::nonnull]] continue; // expected-error {{'nonnull' attribute cannot be applied to a statement}} ignored}} } while (0); - [[carries_dependency]] while (0); // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} + [[gnu::nonnull]] while (0); // expected-error {{'nonnull' attribute cannot be applied to a statement}} - [[carries_dependency]] switch (i) { // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} ignored}} - [[carries_dependency]] case 0: // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - [[carries_dependency]] default: // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - [[carries_dependency]] break; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} + [[gnu::nonnull]] switch (i) { // expected-error {{'nonnull' attribute cannot be applied to a statement}} ignored}} + [[gnu::nonnull]] case 0: // expected-error {{'nonnull' attribute cannot be applied to a statement}} + [[gnu::nonnull]] default: // expected-error {{'nonnull' attribute cannot be applied to a statement}} + [[gnu::nonnull]] break; // expected-error {{'nonnull' attribute cannot be applied to a statement}} } - [[carries_dependency]] goto here; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} + [[gnu::nonnull]] goto here; // expected-error {{'nonnull' attribute cannot be applied to a statement}} - [[carries_dependency]] try { // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} + [[gnu::nonnull]] try { // expected-error {{'nonnull' attribute cannot be applied to a statement}} } catch (...) { } - [[carries_dependency]] return; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} + [[gnu::nonnull]] return; // expected-error {{'nonnull' attribute cannot be applied to a statement}} { [[ ]] // expected-error {{an attribute list cannot appear here}} Index: clang/test/Parser/stmt-attributes.c =================================================================== --- clang/test/Parser/stmt-attributes.c +++ clang/test/Parser/stmt-attributes.c @@ -41,7 +41,7 @@ __attribute__((unused)) switch (i) { // expected-error {{'unused' attribute cannot be applied to a statement}} __attribute__((uuid)) case 0: // expected-warning {{unknown attribute 'uuid' ignored}} __attribute__((visibility(""))) default: // expected-error {{'visibility' attribute cannot be applied to a statement}} - __attribute__((carries_dependency)) break; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} + __attribute__((nonnull)) break; // expected-error {{'nonnull' attribute cannot be applied to a statement}} } __attribute__((fastcall)) goto there; // expected-error {{'fastcall' attribute cannot be applied to a statement}} @@ -49,26 +49,26 @@ __attribute__((weakref)) return; // expected-error {{'weakref' attribute only applies to variables and functions}} - __attribute__((carries_dependency)); // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - __attribute__((carries_dependency)) {} // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - __attribute__((carries_dependency)) if (0) {} // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - __attribute__((carries_dependency)) for (;;); // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - __attribute__((carries_dependency)) do { // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - __attribute__((carries_dependency)) continue; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} ignored}} + __attribute__((nonnull)); // expected-error {{'nonnull' attribute cannot be applied to a statement}} + __attribute__((nonnull)) {} // expected-error {{'nonnull' attribute cannot be applied to a statement}} + __attribute__((nonnull)) if (0) {} // expected-error {{'nonnull' attribute cannot be applied to a statement}} + __attribute__((nonnull)) for (;;); // expected-error {{'nonnull' attribute cannot be applied to a statement}} + __attribute__((nonnull)) do { // expected-error {{'nonnull' attribute cannot be applied to a statement}} + __attribute__((nonnull)) continue; // expected-error {{'nonnull' attribute cannot be applied to a statement}} ignored}} } while (0) ; - __attribute__((carries_dependency)) while (0); // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} + __attribute__((nonnull)) while (0); // expected-error {{'nonnull' attribute cannot be applied to a statement}} - __attribute__((carries_dependency)) switch (i) { // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} ignored}} - __attribute__((carries_dependency)) case 0: // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - __attribute__((carries_dependency)) default: // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} - __attribute__((carries_dependency)) break; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} + __attribute__((nonnull)) switch (i) { // expected-error {{'nonnull' attribute cannot be applied to a statement}} ignored}} + __attribute__((nonnull)) case 0: // expected-error {{'nonnull' attribute cannot be applied to a statement}} + __attribute__((nonnull)) default: // expected-error {{'nonnull' attribute cannot be applied to a statement}} + __attribute__((nonnull)) break; // expected-error {{'nonnull' attribute cannot be applied to a statement}} } - __attribute__((carries_dependency)) goto here; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} + __attribute__((nonnull)) goto here; // expected-error {{'nonnull' attribute cannot be applied to a statement}} - __attribute__((carries_dependency)) return; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} + __attribute__((nonnull)) return; // expected-error {{'nonnull' attribute cannot be applied to a statement}} } void bar(void); Index: clang/test/Preprocessor/has_attribute.cpp =================================================================== --- clang/test/Preprocessor/has_attribute.cpp +++ clang/test/Preprocessor/has_attribute.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -triple i386-windows -fms-compatibility -std=c++11 -E -P %s -o - | FileCheck %s --check-prefixes=CHECK,WINDOWS --implicit-check-not=: #define CXX11(x) x: __has_cpp_attribute(x) +#define NOT_SUPPORTED(x) x: __has_cpp_attribute(x) // CHECK: clang::fallthrough: 201603L CXX11(clang::fallthrough) @@ -35,7 +36,7 @@ // Test for standard attributes as listed in C++2a [cpp.cond] paragraph 6. CXX11(assert) -CXX11(carries_dependency) +NOT_SUPPORTED(carries_dependency) CXX11(deprecated) CXX11(ensures) CXX11(expects) @@ -47,7 +48,7 @@ CXX11(noreturn) CXX11(unlikely) // FIXME(201806L) CHECK: assert: 0 -// CHECK: carries_dependency: 200809L +// CHECK: carries_dependency: 0 // CHECK: deprecated: 201309L // FIXME(201806L) CHECK: ensures: 0 // FIXME(201806L) CHECK: expects: 0 Index: clang/test/SemaCXX/attr-cxx0x.cpp =================================================================== --- clang/test/SemaCXX/attr-cxx0x.cpp +++ clang/test/SemaCXX/attr-cxx0x.cpp @@ -46,7 +46,7 @@ static_assert(alignof(int(int)) >= 1, "alignof(function) not positive"); // expected-error{{invalid application of 'alignof' to a function type}} -[[__carries_dependency__]] +[[__carries_dependency__]] // expected-warning {{unknown attribute '__carries_dependency__' ignored}} void func(void); alignas(4) auto PR19252 = 0;