template struct S { }; template class TT> void foo(); void bar() { foo(); // { dg-error "no matching function" } // { dg-error "type/value mismatch at argument 1" "" { target *-*-* } .-1 } // { dg-message "expected a template of type .template class TT., got .template struct S." "" { target *-*-* } .-2 } }