https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126755
--- Comment #3 from Jason Liam <jlame646 at gmail dot com> ---
Here is another example:
struct S {
template<typename T>
constexpr operator T()&&
{
return 10;
}
constexpr operator int()const
{
return 4;
}
};
template<typename T=int> constexpr int f(S&&){return 10;}
constexpr int f(const S&){return 4;}
static_assert(f(S{})==10); //#4 accepted by all compilers
as expected
//static_assert( S{}==10); //#5 MSVC NO, Clang NO, GCC OK,
EDG OK
static_assert(S{}.operator int() ==10); //#6 MSVC NO, Clang OK, GCC NO,
EDG NO