//PR c++/28736 template struct A // { dg-error "not a valid type" } { template friend struct B; }; template struct B {}; B b; // { dg-error "template argument|invalid type" }