Nice when fixing a bug is as easy as removing incorrect checks.
gcc/cp/ChangeLog:
PR c++/98717
* constraint.cc (build_concept_check_arguments): Remove assert.
(build_concept_check): Allow empty args.
gcc/testsuite/ChangeLog:
PR c++/98717
* g++.dg/cpp2a/concepts-variadic3.C: New test.
}
else
{
- gcc_assert (rest != NULL_TREE);
args = rest;
}
return args;
tree
build_concept_check (tree decl, tree arg, tree rest, tsubst_flags_t complain)
{
- if (arg == NULL_TREE && rest == NULL_TREE)
- {
- tree id = build_nt (TEMPLATE_ID_EXPR, decl, rest);
- error ("invalid use concept %qE", id);
- return error_mark_node;
- }
-
tree args = build_concept_check_arguments (arg, rest);
if (standard_concept_p (decl))
--- /dev/null
+// PR c++/98717
+// { dg-do compile { target c++20 } }
+
+template<typename... T>
+concept True = true;
+
+static_assert(True<>);