// { dg-do compile } // Origin: Volker Reichelt and // Alexandre Oliva // PR c++/18757: ICE in get_innermost_template_args struct A { template void foo(int); // { dg-message "note" } template void bar(T t) { // { dg-message "note" } this->foo(t); } // { dg-error "expected|parse error|no matching" } // { dg-message "candidate" "candidate note" { target *-*-* } 12 } 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" } // { dg-message "candidate" "candidate note" { target *-*-* } 22 } void bad(T t) { B::bar(t); } // { dg-error "invalid|not a template" } }; void baz() { A().bar(0); A().bad(0); B().bar(0); }