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

--- Comment #3 from Casey Carter <Casey at Carter dot net> ---
Now this program compiles:

template <class T, class U>
concept bool Same = __is_same_as(T, U);

template <class T>
concept bool C =
  requires {
    { 0 } -> Same<T>;
    { 3.14 } -> Same<T>;
    { nullptr } -> Same<T>;
    { "Hello, World!" } -> Same<T>;
  };

template <C>
constexpr bool f() { return true; }

struct A {};
struct B {};

static_assert(f<double>(), "");
static_assert(f<int>(), "");
static_assert(f<void*>(), "");
static_assert(f<A>(), "");
static_assert(f<B>(), "");
static_assert(f<int(int)>(), "");
static_assert(f<int&&>(), "");
static_assert(f<int[][2]>(), "");

int main() {}

I'm pretty sure deduction constraints still aren't doing the right thing ;)

Reply via email to