diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index b38d7704e3450..b6516419a4936 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -4128,7 +4128,8 @@ def err_feature_invalid_for_decl : Error< def err_feature_merge_incompatible : Error< "cannot merge incompatible feature attribute to this decl">; def warn_new_feature_redeclaration : Warning< - "new domain availability attributes cannot be added to redeclarations">, DefaultError; + "new domain availability attributes cannot be added to redeclarations">, + InGroup>, DefaultError; def err_feature_invalid_added : Error< "cannot add feature availability to this decl">; def note_feature_incompatible0 : Note< diff --git a/clang/test/Sema/feature-availability.c b/clang/test/Sema/feature-availability.c index 22f30777aa4d3..9b2def0eb3760 100644 --- a/clang/test/Sema/feature-availability.c +++ b/clang/test/Sema/feature-availability.c @@ -1,5 +1,6 @@ -// RUN: %clang_cc1 -triple arm64-apple-macosx15 -fblocks -ffeature-availability=feature1:1 -ffeature-availability=feature2:0 -ffeature-availability=feature3:on -fsyntax-only -Wunreachable-code -verify %s -// RUN: %clang_cc1 -triple arm64-apple-macosx15 -fblocks -fsyntax-only -Wunreachable-code -verify -DUSE_DOMAIN %s +// RUN: %clang_cc1 -triple arm64-apple-macosx15 -fblocks -ffeature-availability=feature1:1 -ffeature-availability=feature2:0 -ffeature-availability=feature3:on -fsyntax-only -Wunreachable-code -verify=expected,redecl %s +// RUN: %clang_cc1 -triple arm64-apple-macosx15 -fblocks -ffeature-availability=feature1:1 -ffeature-availability=feature2:0 -ffeature-availability=feature3:on -fsyntax-only -Wunreachable-code -Wno-domain-availability-redeclaration -verify=expected %s +// RUN: %clang_cc1 -triple arm64-apple-macosx15 -fblocks -fsyntax-only -Wunreachable-code -verify=expected,redecl -DUSE_DOMAIN %s #include @@ -75,12 +76,12 @@ void (* __attribute__((availability(domain:feature2, AVAIL))) fp3)(void) = func6 void func6(void); __attribute__((availability(domain:feature1, AVAIL))) void func6(void); // expected-note {{is incompatible with __attribute__((availability(domain:feature1, 0)))}} __attribute__((availability(domain:feature1, UNAVAIL))) void func6(void); // expected-error {{cannot merge incompatible feature attribute to this decl}} expected-note {{feature attribute __attribute__((availability(domain:feature1, 1)))}} -__attribute__((availability(domain:feature1, AVAIL))) void func8(void); // expected-error {{new domain availability attributes cannot be added to redeclarations}} +__attribute__((availability(domain:feature1, AVAIL))) void func8(void); // redecl-error {{new domain availability attributes cannot be added to redeclarations}} int g0; __attribute__((availability(domain:feature1, AVAIL))) int g0; // expected-note {{is incompatible with __attribute__((availability(domain:feature1, 0)))}} __attribute__((availability(domain:feature1, UNAVAIL))) int g0; // expected-error {{cannot merge incompatible feature attribute to this decl}} expected-note {{feature attribute __attribute__((availability(domain:feature1, 1)))}} -__attribute__((availability(domain:feature1, AVAIL))) int g2;// expected-error {{new domain availability attributes cannot be added to redeclarations}} +__attribute__((availability(domain:feature1, AVAIL))) int g2;// redecl-error {{new domain availability attributes cannot be added to redeclarations}} typedef int INT0 __attribute__((availability(domain:feature2, AVAIL))); typedef INT0 INT1 __attribute__((availability(domain:feature2, AVAIL)));