// PR c++/35146 template struct S {}; template struct ref; template <> struct ref { typedef double result; }; template void foo(typename ref::result, S*); template <> void foo(S, S*); // { dg-error "does not match" } template <> void foo(double alpha, S* x) { alpha; x; }