// Verify we check arity early before deduction without explicit // template arguments. // PR c++/84075 template struct trait { static const int value = T::value; // { dg-bogus "not a member of 'B'" } }; template::value> struct A { }; template void f(A, int); // #1 struct B { }; template class TT> void f(TT); // #2 int main() { A a; f(a, 0); // OK, deduction for #2 short-circuited and A not specialized, // which would have resulted in a hard error }