http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48934
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-05-09 14:05:06 UTC --- Another example: template<typename T> struct S1 { typedef char type; }; template<typename T> typename S1<T>::type foo(typename S1<T>::typo) { return t; } char c = foo<int>(1); Here the return type is valid, but the parameter is not ("typo" vs "type"). Ideally the diagnostic would indicate that, which would help when the template arguments are substituted in more than one place. My dream compiler would tell me exactly where it failed e.g. template<bool> struct S2 { typedef char type; }; template<typename U> struct S3 { static const bool V = true; }; template<typename T> typename S2<S3<T>::val>::type // no 'val' foo(T t) { return t; } char c = foo(1); This fails because "S3<T>::val" is an invalid expression ("val" vs "V") My dream compiler would tell me which sub-expression was invalid, as this could be a huge help when debugging complex SFINAE cases with nested expressions and types. I realise that might be very difficult to do and that as a library implementor my wishlist may not be typical of most users. Simply saying something like "substitution failed" would already be a nice improvement.