From 60feac73e12d0f39171880bf9712a7e157511b89 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 2 Sep 2019 23:27:54 +0000 Subject: [PATCH] Rename -Wc++20-designator to -Wc++2a-designator for consistency and add some test coverage for the flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370689 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticGroups.td | 4 ++-- test/SemaCXX/cxx2a-initializer-aggregates.cpp | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index aa1773481d..ee6ecb9a44 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -146,9 +146,9 @@ def Deprecated : DiagGroup<"deprecated", [DeprecatedAttributes, DeprecatedWritableStr]>, 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 -// 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 GNUDesignator : DiagGroup<"gnu-designator">; diff --git a/test/SemaCXX/cxx2a-initializer-aggregates.cpp b/test/SemaCXX/cxx2a-initializer-aggregates.cpp index c24c53e562..7dc2500dbb 100644 --- a/test/SemaCXX/cxx2a-initializer-aggregates.cpp +++ b/test/SemaCXX/cxx2a-initializer-aggregates.cpp @@ -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=expected,pedantic -Werror=c99-designator -Wno-reorder-init-list -Wno-initializer-overrides -// 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=expected,override -Wno-c99-designator -Wno-reorder-init-list -Werror=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,pedantic,override,reorder -pedantic-errors +// 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=cxx20,expected,pedantic -Werror=c99-designator -Wno-reorder-init-list -Wno-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=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 { - struct A { // expected-note 6{{candidate}} - A() = default; // expected-note 3{{candidate}} + struct A { // cxx20-note 6{{candidate}} + A() = default; // cxx20-note 3{{candidate}} int x; int y; }; - A a = {1, 2}; // expected-error {{no matching constructor}} + A a = {1, 2}; // cxx20-error {{no matching constructor}} struct B { int x; @@ -24,7 +25,7 @@ namespace class_with_ctor { A a; }; 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 { -- 2.40.0