Contrary to https://timsong-cpp.github.io/cppwp/n4861/class.conv.fct#6, GCC allows a conversion function template with a deduced return type: struct A { template<class=void> constexpr operator auto() const { return 1; } }; constexpr int f() { return A{}.template operator auto(); } static_assert( f() == 1 ); Online demo: https://godbolt.org/z/s8oK6rnPY In addition, the diagnostics "warning: use of 'auto' in member template conversion operator can never be deduced" seems wrong.
Confirmed. This is https://cplusplus.github.io/CWG/issues/1878.html