forked from OSchip/llvm-project
Rename -Wc++20-designator to -Wc++2a-designator for consistency and add
some test coverage for the flag. llvm-svn: 370689
This commit is contained in:
parent
34a38a3b54
commit
ea366122d2
|
@ -146,9 +146,9 @@ def Deprecated : DiagGroup<"deprecated", [DeprecatedAttributes,
|
||||||
DeprecatedWritableStr]>,
|
DeprecatedWritableStr]>,
|
||||||
DiagCategory<"Deprecations">;
|
DiagCategory<"Deprecations">;
|
||||||
|
|
||||||
def CXX2aDesignator : DiagGroup<"c++20-designator">;
|
def CXX2aDesignator : DiagGroup<"c++2a-designator">;
|
||||||
// Allow -Wno-c99-designator to be used to turn off all warnings on valid C99
|
// Allow -Wno-c99-designator to be used to turn off all warnings on valid C99
|
||||||
// designators (including the warning controlled by -Wc++20-designator).
|
// designators (including the warning controlled by -Wc++2a-designator).
|
||||||
def C99Designator : DiagGroup<"c99-designator", [CXX2aDesignator]>;
|
def C99Designator : DiagGroup<"c99-designator", [CXX2aDesignator]>;
|
||||||
def GNUDesignator : DiagGroup<"gnu-designator">;
|
def GNUDesignator : DiagGroup<"gnu-designator">;
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
// RUN: %clang_cc1 -std=c++2a %s -verify=expected,pedantic,override,reorder -pedantic-errors
|
// RUN: %clang_cc1 -std=c++2a %s -verify=cxx20,expected,pedantic,override,reorder -pedantic-errors
|
||||||
// RUN: %clang_cc1 -std=c++2a %s -verify=expected,pedantic -Werror=c99-designator -Wno-reorder-init-list -Wno-initializer-overrides
|
// RUN: %clang_cc1 -std=c++17 %s -verify=expected,pedantic,override,reorder -Wno-c++2a-designator -pedantic-errors
|
||||||
// RUN: %clang_cc1 -std=c++2a %s -verify=expected,reorder -Wno-c99-designator -Werror=reorder-init-list -Wno-initializer-overrides
|
// RUN: %clang_cc1 -std=c++2a %s -verify=cxx20,expected,pedantic -Werror=c99-designator -Wno-reorder-init-list -Wno-initializer-overrides
|
||||||
// RUN: %clang_cc1 -std=c++2a %s -verify=expected,override -Wno-c99-designator -Wno-reorder-init-list -Werror=initializer-overrides
|
// RUN: %clang_cc1 -std=c++2a %s -verify=cxx20,expected,reorder -Wno-c99-designator -Werror=reorder-init-list -Wno-initializer-overrides
|
||||||
// RUN: %clang_cc1 -std=c++2a %s -verify -Wno-c99-designator -Wno-reorder-init-list -Wno-initializer-overrides
|
// RUN: %clang_cc1 -std=c++2a %s -verify=cxx20,expected,override -Wno-c99-designator -Wno-reorder-init-list -Werror=initializer-overrides
|
||||||
|
// RUN: %clang_cc1 -std=c++2a %s -verify=cxx20,expected -Wno-c99-designator -Wno-reorder-init-list -Wno-initializer-overrides
|
||||||
|
|
||||||
|
|
||||||
namespace class_with_ctor {
|
namespace class_with_ctor {
|
||||||
struct A { // expected-note 6{{candidate}}
|
struct A { // cxx20-note 6{{candidate}}
|
||||||
A() = default; // expected-note 3{{candidate}}
|
A() = default; // cxx20-note 3{{candidate}}
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
};
|
};
|
||||||
A a = {1, 2}; // expected-error {{no matching constructor}}
|
A a = {1, 2}; // cxx20-error {{no matching constructor}}
|
||||||
|
|
||||||
struct B {
|
struct B {
|
||||||
int x;
|
int x;
|
||||||
|
@ -24,7 +25,7 @@ namespace class_with_ctor {
|
||||||
A a;
|
A a;
|
||||||
};
|
};
|
||||||
C c1 = {{}, {}}; // ok, call default ctor twice
|
C c1 = {{}, {}}; // ok, call default ctor twice
|
||||||
C c2 = {{1, 2}, {3, 4}}; // expected-error 2{{no matching constructor}}
|
C c2 = {{1, 2}, {3, 4}}; // cxx20-error 2{{no matching constructor}}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace designator {
|
namespace designator {
|
||||||
|
|
Loading…
Reference in New Issue