https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126992
Bug ID: 126992
Summary: GCC produces different output based on whether
conversion function is explicitly called or not
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jlame646 at gmail dot com
Target Milestone: ---
Consider the following program where gcc gives different behavior for #5 and
#6.
```
struct S {
template<typename T>
constexpr operator T()&&
{
return 10;
}
constexpr operator int()const
{
return 4;
}
};
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
```
I think both #5 and #6 should give same result.