// PR c++/116064 // { dg-additional-options -fpermissive } // Like permissive-error1.C but verify instantiating the errorneous // templates gives an error after all. template void f() { // { dg-error "instantiating erroneous template" } const int n = 42; ++n; // { dg-warning "read-only variable 'n' .-Wtemplate-body." } // { dg-message "first error appeared here" "" { target *-*-* } .-1 } // { dg-error "read-only variable 'n'\[\n\r\]" "" { target *-*-* } .-2 } } template struct A { void f(typename A::type); // { dg-warning "does not name a type" } }; template struct B { void f() { this->g(); // { dg-warning "no member" } } }; int main() { f(); // { dg-message "required from here" } A a; B b; b.f(); }