https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126992

--- Comment #4 from Jason Liam <jlame646 at gmail dot com> ---
It is also interesting to note that we can reproduce the same problem if we use
explicit object parameter(EOP) but only for `#5`(as shown below). But when we
use EOP, all compilers reject `#6`. So, again we have different behavior issue
here. [Demo](https://godbolt.org/z/xr7Tx5v69)
```
struct S {

    template<typename T>
    constexpr operator T(this S&&)     
    {
        return 10;
    }
    constexpr operator int(this const S&)
    {
        return 4;
    }

};

static_assert( S{}==10);                          //#5 GCC OK, EDG OK, MSVC NO,
Clang NO 
// static_assert(S{}.operator int() ==10);        //#6 all compilers reject
this

```

Reply via email to