[Bug c++/66218] [c++-concepts] "=?UTF-8?Q?inconsistent=20deduction=20for=20=E2=80=98auto=E2=80=99?=" with a partial-concept-id in a deduction constraint

Casey at Carter dot net gcc-bugzilla@gcc.gnu.org
Sun Jul 12 05:17:00 GMT 2015


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 ;)



More information about the Gcc-bugs mailing list