Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/constexpr-type-def1.C

raw
1 // PR c++/55250
2 // { dg-do compile { target c++11 } }
3
4 constexpr int Test1(int x) { enum E { y = 1 }; return x; } // { dg-error "not a return-statement" "" { target { c++11_only } } }
5
6 constexpr int Test2(int x) { struct T { }; return x; } // { dg-error "not a return-statement" "" { target { c++11_only } } }
7
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
10 constexpr int Test4(int x) { typedef struct T { } TT; return x; } // { dg-error "not a return-statement" "" { target { c++11_only } } }
11
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
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 {
18 constexpr S1() { enum E { y = 1 }; } // { dg-error "does not have empty body" "" { target { c++11_only } } }
19 };
20
21 struct S2
22 {
23 constexpr S2() { struct T { }; } // { dg-error "does not have empty body" "" { target { c++11_only } } }
24 };
25
26 struct S3
27 {
28 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 {
33 constexpr S4() { typedef struct T { } TT; } // { dg-error "does not have empty body" "" { target { c++11_only } } }
34 };
35
36 struct S5
37 {
38 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 {
43 constexpr S6() { using TT = struct T { }; } // { dg-error "does not have empty body" "" { target { c++11_only } } }
44 };