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

--- Comment #2 from Casey Carter <Casey at Carter dot net> ---
If the intent is to allow parameters of void type - and I admit the wording of
5.1.4/5 is unclear as to exactly which of the rules of 8.3.5 are intended to
apply to the parameter-declaration-clause of a requires-expression - then this
program should be well-formed:

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

template <class T>
concept bool C =
  requires (T t, void v) {
    requires Same<decltype(t), decltype(v)>;
  };

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

static_assert(is_c<void>(), "");

int main() {}

which the compiler diagnoses with "error: invalid use of type ‘void’ in
parameter declaration".

Reply via email to