https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96242
Bug ID: 96242
Summary: ICE conditionally noexcept defaulted comparison
Product: gcc
Version: 11.0
URL: https://godbolt.org/z/z4q4Tv
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: johelegp at gmail dot com
Target Milestone: ---
See https://godbolt.org/z/z4q4Tv.
```C++
template <bool B = true>
struct X
{
bool operator==(const X&) const noexcept(B) = default;
};
using Y = decltype(X{} == X{});
```
```C++
#include <compare>
template <bool B = true>
struct X
{
auto operator<=>(const X&) const noexcept(B) = default;
};
using Y = decltype(X{} <= X{});
```