1 // PR c++/55250
2 // { dg-do compile { target c++11 } }
3
Test1(int x)4 constexpr int Test1(int x) { enum E { y = 1 }; return x; } // { dg-error "not a return-statement" "" { target { c++11_only } } }
5
Test2(int x)6 constexpr int Test2(int x) { struct T { }; return x; } // { dg-error "not a return-statement" "" { target { c++11_only } } }
7
Test3(int x)8 constexpr int Test3(int x) { typedef enum E { y = 1 } EE; return x; } // { dg-error "not a return-statement" "" { target { c++11_only } } }
9
Test4(int x)10 constexpr int Test4(int x) { typedef struct T { } TT; return x; } // { dg-error "not a return-statement" "" { target { c++11_only } } }
11
Test5(int x)12 constexpr int Test5(int x) { using EE = enum E { y = 1 }; return x; } // { dg-error "not a return-statement" "" { target { c++11_only } } }
13
Test6(int x)14 constexpr int Test6(int x) { using TT = struct T { }; return x; } // { dg-error "not a return-statement" "" { target { c++11_only } } }
15
16 struct S1
17 {
S1S118 constexpr S1() { enum E { y = 1 }; } // { dg-error "does not have empty body" "" { target { c++11_only } } }
19 };
20
21 struct S2
22 {
S2S223 constexpr S2() { struct T { }; } // { dg-error "does not have empty body" "" { target { c++11_only } } }
24 };
25
26 struct S3
27 {
S3S328 constexpr S3() { typedef enum E { y = 1 } EE; } // { dg-error "does not have empty body" "" { target { c++11_only } } }
29 };
30
31 struct S4
32 {
S4S433 constexpr S4() { typedef struct T { } TT; } // { dg-error "does not have empty body" "" { target { c++11_only } } }
34 };
35
36 struct S5
37 {
S5S538 constexpr S5() { using EE = enum E { y = 1 }; } // { dg-error "does not have empty body" "" { target { c++11_only } } }
39 };
40
41 struct S6
42 {
S6S643 constexpr S6() { using TT = struct T { }; } // { dg-error "does not have empty body" "" { target { c++11_only } } }
44 };
45