https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61732
--- Comment #4 from Joaquín M López Muñoz <joaquin at tid dot es> ---
I see. The following is slightly off-topic, so please tell me if you can carry
on the discussion offline. Why is such an instantiation error not
SFINAE-protected in the following example?
template<class Base> struct derived:Base{typedef int type;};
struct X final{};
template<typename T>
void foo(T*,typename derived<T>::type=0){}
void foo(...){}
int main()
{
X* x;
foo(x);
}
GCC fails to compile with "cannot derive from X" instead of omitting the
instantiation of foo<X> and resorting to foo(...) instead.