r370689 - Rename -Wc++20-designator to -Wc++2a-designator for consistency and add

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 2 16:27:54 PDT 2019


Author: rsmith
Date: Mon Sep  2 16:27:54 2019
New Revision: 370689

URL: http://llvm.org/viewvc/llvm-project?rev=370689&view=rev
Log:
Rename -Wc++20-designator to -Wc++2a-designator for consistency and add
some test coverage for the flag.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticGroups.td
    cfe/trunk/test/SemaCXX/cxx2a-initializer-aggregates.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=370689&r1=370688&r2=370689&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Mon Sep  2 16:27:54 2019
@@ -146,9 +146,9 @@ def Deprecated : DiagGroup<"deprecated",
                                           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">;
 

Modified: cfe/trunk/test/SemaCXX/cxx2a-initializer-aggregates.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx2a-initializer-aggregates.cpp?rev=370689&r1=370688&r2=370689&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/cxx2a-initializer-aggregates.cpp (original)
+++ cfe/trunk/test/SemaCXX/cxx2a-initializer-aggregates.cpp Mon Sep  2 16:27:54 2019
@@ -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 {




More information about the cfe-commits mailing list