r272575 - Add test for DR1359.
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 13 12:04:45 PDT 2016
Author: rsmith
Date: Mon Jun 13 14:04:44 2016
New Revision: 272575
URL: http://llvm.org/viewvc/llvm-project?rev=272575&view=rev
Log:
Add test for DR1359.
Modified:
cfe/trunk/test/CXX/drs/dr13xx.cpp
cfe/trunk/www/cxx_dr_status.html
Modified: cfe/trunk/test/CXX/drs/dr13xx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr13xx.cpp?rev=272575&r1=272574&r2=272575&view=diff
==============================================================================
--- cfe/trunk/test/CXX/drs/dr13xx.cpp (original)
+++ cfe/trunk/test/CXX/drs/dr13xx.cpp Mon Jun 13 14:04:44 2016
@@ -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
+}
Modified: cfe/trunk/www/cxx_dr_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_dr_status.html?rev=272575&r1=272574&r2=272575&view=diff
==============================================================================
--- cfe/trunk/www/cxx_dr_status.html (original)
+++ cfe/trunk/www/cxx_dr_status.html Mon Jun 13 14:04:44 2016
@@ -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>
More information about the cfe-commits
mailing list