diff options
Diffstat (limited to 'test/CXX/special/class.ctor/p6-0x.cpp')
-rw-r--r-- | test/CXX/special/class.ctor/p6-0x.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/CXX/special/class.ctor/p6-0x.cpp b/test/CXX/special/class.ctor/p6-0x.cpp index 8c8800f..9860317 100644 --- a/test/CXX/special/class.ctor/p6-0x.cpp +++ b/test/CXX/special/class.ctor/p6-0x.cpp @@ -55,3 +55,42 @@ struct A {}; // expected-note {{here}} struct B { friend A::A(); // expected-error {{non-constexpr declaration of 'A' follows constexpr declaration}} }; + +namespace UnionCtors { + union A { // expected-note {{here}} + int a; + int b; + }; + union B { + int a; + int b = 5; + }; + union C { + int a = 5; + int b; + }; + struct D { + union { + int a = 5; + int b; + }; + union { + int c; + int d = 5; + }; + }; + struct E { // expected-note {{here}} + union { + int a; + int b; + }; + }; + + struct Test { + friend constexpr A::A() noexcept; // expected-error {{follows non-constexpr declaration}} + friend constexpr B::B() noexcept; + friend constexpr C::C() noexcept; + friend constexpr D::D() noexcept; + friend constexpr E::E() noexcept; // expected-error {{follows non-constexpr declaration}} + }; +} |