c++: Empty args for variadic concept [PR98717]
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.
This commit is contained in:
parent
65c1cb3589
commit
4e7c24d97d
2 changed files with 7 additions and 8 deletions
|
@ -1345,7 +1345,6 @@ build_concept_check_arguments (tree arg, tree rest)
|
|||
}
|
||||
else
|
||||
{
|
||||
gcc_assert (rest != NULL_TREE);
|
||||
args = rest;
|
||||
}
|
||||
return args;
|
||||
|
@ -1444,13 +1443,6 @@ build_concept_check (tree target, tree args, tsubst_flags_t complain)
|
|||
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))
|
||||
|
|
7
gcc/testsuite/g++.dg/cpp2a/concepts-variadic3.C
Normal file
7
gcc/testsuite/g++.dg/cpp2a/concepts-variadic3.C
Normal file
|
@ -0,0 +1,7 @@
|
|||
// PR c++/98717
|
||||
// { dg-do compile { target c++20 } }
|
||||
|
||||
template<typename... T>
|
||||
concept True = true;
|
||||
|
||||
static_assert(True<>);
|
Loading…
Add table
Reference in a new issue