From: Richard Smith Date: Mon, 13 Jun 2016 19:04:44 +0000 (+0000) Subject: Add test for DR1359. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56fdf6c411068bbc01fcd802eddb489c79bf4852;p=clang Add test for DR1359. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272575 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CXX/drs/dr13xx.cpp b/test/CXX/drs/dr13xx.cpp index 37c144eb0e..8c3e7f2a04 100644 --- a/test/CXX/drs/dr13xx.cpp +++ b/test/CXX/drs/dr13xx.cpp @@ -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 +} diff --git a/www/cxx_dr_status.html b/www/cxx_dr_status.html index 8e0646d8ee..245b865a6a 100644 --- a/www/cxx_dr_status.html +++ b/www/cxx_dr_status.html @@ -7969,7 +7969,7 @@ and POD class 1359 CD3 constexpr union constructors - Unknown + SVN 1360