r311868 - Add test for -Wc++17-compat warning for P0683R1.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 27 17:31:35 PDT 2017


Author: rsmith
Date: Sun Aug 27 17:31:35 2017
New Revision: 311868

URL: http://llvm.org/viewvc/llvm-project?rev=311868&view=rev
Log:
Add test for -Wc++17-compat warning for P0683R1.

Modified:
    cfe/trunk/test/SemaCXX/cxx17-compat.cpp

Modified: cfe/trunk/test/SemaCXX/cxx17-compat.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx17-compat.cpp?rev=311868&r1=311867&r2=311868&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/cxx17-compat.cpp (original)
+++ cfe/trunk/test/SemaCXX/cxx17-compat.cpp Sun Aug 27 17:31:35 2017
@@ -19,4 +19,11 @@ struct B {
     // expected-warning at -4 {{explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++2a}}
 #endif
   }
+
+  int n : 5 = 0;
+#if __cplusplus <= 201703L
+    // expected-warning at -2 {{default member initializer for bit-field is a C++2a extension}}
+#else
+    // expected-warning at -4 {{default member initializer for bit-field is incompatible with C++ standards before C++2a}}
+#endif
 };




More information about the cfe-commits mailing list