// { dg-do compile } // { dg-options "-std=c++0x" } //This error is diagnosed at instantiation time template struct S1 { enum E : T; // { dg-error "previous definition" } enum E : int; // { dg-error "different underlying type" } }; template struct S1; // { dg-message "required from here" } template struct S2 { enum E : T; enum E : T; }; template struct S2; template struct S3 { enum E : T1; enum E : T2; }; template struct S3; template struct S4 { enum E : T1; // { dg-error "previous definition" } enum E : T2; // { dg-error "different underlying type" } }; template struct S4; // { dg-message "required from here" }