http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59056
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- I must be misunderstanding something, because rewriting the class template partial specializations as function templates (as per [temp.class.order]) shows that one is more specialized than the other, as the functions are not ambiguous: #include <type_traits> template <class T> class Foo {}; template <class X> constexpr bool check() { return true; } template <class X, class Enable = void> struct Bar {}; template<class X> void func(Bar<X, typename std::enable_if< check<X>() >::type>) { } template<class T> int func(Bar<Foo<T>>) { return 0; } void instance() { Bar< Foo<int> > av; int i = func(av); } I thought if the partial specializations were ambiguous then these function overloads should be too.