blob: e5d8e49537c23cafcd4750bad30177b21c643279 [file] [log] [blame]
// { dg-do compile { target c++11 } }
//This error is diagnosed at instantiation time
template<typename T> struct S1
{
enum E : T; // { dg-message "previous definition" }
enum E : int; // { dg-error "different underlying type" }
};
template struct S1<short>;
template<typename T> struct S2
{
enum E : T;
enum E : T;
};
template struct S2<short>;
template<typename T1, typename T2> struct S3
{
enum E : T1; // { dg-message "previous definition" }
enum E : T2; // { dg-error "different underlying type" }
};
template struct S3<short,short>;
template<typename T1, typename T2> struct S4
{
enum E : T1; // { dg-message "previous definition" }
enum E : T2; // { dg-error "different underlying type" }
};
template struct S4<short,char>;