Fix PR c++/69139 (deduction failure with trailing return type)
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / forw_enum8.C
blob5174226a6fdd23caf142a6ba5b39e1b6e848324a
1 // { dg-do compile { target c++11 } }
3 //This instatiation is ok
4 template<typename T> struct S1
6     enum E : int;
7     enum E : T;
8 };
9 template struct S1<int>; //ok
11 //This error is diagnosed at instantiation time
12 template<typename T> struct S2
14     enum E : int;   // { dg-error "previous definition" }
15     enum E : T;     // { dg-error "different underlying type" }
17 template struct S2<short>; // { dg-message "required from here" }
19 //This error is diagnosed at compilation time
20 template<typename T> struct S3
22     enum E : int;   // { dg-error "previous definition" }
23     enum E : short; // { dg-error "different underlying type" }