// { dg-do compile { target c++11 } } template struct S1 { enum E : int; // { dg-message "previous definition" } enum E : T; // { dg-error "different underlying type" } }; template struct S1; //ok template struct S2 { enum E : int; // { dg-message "previous definition" } enum E : T; // { dg-error "different underlying type" } }; template struct S2; template struct S3 { enum E : int; // { dg-message "previous definition" } enum E : short; // { dg-error "different underlying type" } };