diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-diag5.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-diag5.C | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-diag5.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-diag5.C new file mode 100644 index 0000000000..c0cbfdd1c5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-diag5.C @@ -0,0 +1,48 @@ +// Origin: PR c++/51633 +// { dg-options "-std=c++11" } + +struct A +{ + constexpr A() {} + ~A(); +}; + +struct B +{ + A a; + A b; + A c; + constexpr B() {} +}; + +struct C +{ + A a; + constexpr C() {} +}; + +struct D +{ + constexpr D() { return;} // { dg-error "does not have empty body" } +}; + +struct D1 +{ + A a; + constexpr D1() { return;} // { dg-error "does not have empty body" } +}; + +struct D2 +{ + A a; + A b; + constexpr D2() { return;} // { dg-error "does not have empty body" } +}; + +struct D3 +{ + A a; + A b; + A c; + constexpr D3() { return;} // { dg-error "does not have empty body" } +}; |