/* This used to ICE (PR c++/29573) */ /* { dg-do compile } */ template struct A {}; template struct B : A {}; /* { dg-error "" } */ template struct C : A {}; /* { dg-error "" } */ int a; template struct D : A {}; /* This used to ICE as well. */ template struct E : A {}; /* This used to ICE as well. */