]> granicus.if.org Git - clang/commitdiff
Add test for DR1359.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 13 Jun 2016 19:04:44 +0000 (19:04 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 13 Jun 2016 19:04:44 +0000 (19:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272575 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/drs/dr13xx.cpp
www/cxx_dr_status.html

index 37c144eb0e015b2b5f67c32f9b34a031edbbf65c..8c3e7f2a04ca15f8bded6f74e3ae3f70d80d1671 100644 (file)
@@ -28,3 +28,19 @@ namespace dr1346 { // dr1346: 3.5
   }
 #endif
 }
+
+namespace dr1359 { // dr1359: 3.5
+#if __cplusplus >= 201103L
+  union A { constexpr A() = default; };
+  union B { constexpr B() = default; int a; }; // expected-error {{not constexpr}} expected-note 2{{candidate}}
+  union C { constexpr C() = default; int a, b; }; // expected-error {{not constexpr}} expected-note 2{{candidate}}
+  struct X { constexpr X() = default; union {}; };
+  struct Y { constexpr Y() = default; union { int a; }; }; // expected-error {{not constexpr}} expected-note 2{{candidate}}
+
+  constexpr A a = A();
+  constexpr B b = B(); // expected-error {{no matching}}
+  constexpr C c = C(); // expected-error {{no matching}}
+  constexpr X x = X();
+  constexpr Y y = Y(); // expected-error {{no matching}}
+#endif
+}
index 8e0646d8ee4c63c100099280877156c32f9c50cb..245b865a6adc3300b206f919e015b1f7aab9644a 100644 (file)
@@ -7969,7 +7969,7 @@ and <I>POD class</I></td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1359">1359</a></td>
     <td>CD3</td>
     <td><TT>constexpr</TT> union constructors</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="svn" align="center">SVN</td>
   </tr>
   <tr class="open" id="1360">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1360">1360</a></td>