Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/forw_enum10.C

raw
1 // { dg-do compile { target c++11 } }
2
3 //This error is diagnosed at instantiation time
4 template<typename T> struct S1
5 {
6 enum E : T; // { dg-message "previous definition" }
7 enum E : int; // { dg-error "different underlying type" }
8 };
9 template struct S1<short>;
10
11 template<typename T> struct S2
12 {
13 enum E : T;
14 enum E : T;
15 };
16 template struct S2<short>;
17
18 template<typename T1, typename T2> struct S3
19 {
20 enum E : T1; // { dg-message "previous definition" }
21 enum E : T2; // { dg-error "different underlying type" }
22 };
23 template struct S3<short,short>;
24
25 template<typename T1, typename T2> struct S4
26 {
27 enum E : T1; // { dg-message "previous definition" }
28 enum E : T2; // { dg-error "different underlying type" }
29 };
30 template struct S4<short,char>;