]> granicus.if.org Git - clang/commitdiff
Add test for -Wc++17-compat warning for P0683R1.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 28 Aug 2017 00:31:35 +0000 (00:31 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 28 Aug 2017 00:31:35 +0000 (00:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311868 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/cxx17-compat.cpp

index 79c8507c9c6bfc012ecf27097a576aa9bc20b90c..3b814340c6daf486d4c8927894adf88795943dcb 100644 (file)
@@ -19,4 +19,11 @@ struct B {
     // expected-warning@-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@-2 {{default member initializer for bit-field is a C++2a extension}}
+#else
+    // expected-warning@-4 {{default member initializer for bit-field is incompatible with C++ standards before C++2a}}
+#endif
 };