https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127373
Drea Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |c++-lambda
--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
>I assume the reason is that gcc does not apply constraints (requires
clauses/concepts)
It does. Because if you used int rather than float, it is accepted.
So it looks like it is lambda related because if I emulate it; things work:
```
#include <concepts>
template <typename T>
using a = T(*)();
struct s2
{
template <std::integral T>
static constexpr T f(){return 0;}
template <std::integral T>
constexpr operator a<T> ()
{
return f;
}
};
struct s3
{
template <std::floating_point T>
static constexpr T f(){return 1;}
template <std::floating_point T>
constexpr operator a<T> ()
{
return f;
}
};
struct foo1: s2, s3 {};
constexpr float(*pfn2)() = foo1{};
static_assert(pfn2() == 1);
constexpr int(*pfn3)() = foo1{};
static_assert(pfn3() == 0);
```