Code using SFINAE working with GCC but not with Clang
问题 I'm trying to use SFINAE in C++11 to implement a serialization library. My code works fine with GCC but not with Clang. I've reduced it here to a minimal code: template <typename A, typename T> constexpr auto has_save_method(A& ar, T& t) -> decltype(t.save(ar), bool()) { return true; } template<class A, typename T, bool has_save> struct saver; template<class A, typename T> struct saver<A,T,true> { static void apply(A& ar, T& t) { t.save(ar); } }; class MyClass { public: template<typename A>