// { dg-do compile } // Origin: Volker Reichelt and // Alexandre Oliva // PR c++/18757: ICE in get_innermost_template_args struct A { template void foo(int); template void bar(T t) { this->foo(t); } // { dg-error "expected|parse error|no matching" } template void bad(T t) { foo(t); } // { dg-error "expected|parse error|no matching" } }; template struct B { void bar(T t) { A().bar(t); } // { dg-error "expected|parse error|no matching" } void bad(T t) { B::bar(t); } // { dg-error "invalid|qualified-id|not a template" } }; void baz() { A().bar(0); A().bad(0); B().bar(0); }