]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: pack in requires-expr parm list [PR107417]
authorPatrick Palka <ppalka@redhat.com>
Sun, 4 Dec 2022 15:47:24 +0000 (10:47 -0500)
committerPatrick Palka <ppalka@redhat.com>
Mon, 19 Dec 2022 16:54:14 +0000 (11:54 -0500)
commitb428bb449be1bdbbd4000b51bb7c665981dc8c8f
tree9309c31a540a0f1cfea3add11c1328017b53e0e0
parent648db321893acabd06c24da149c09fceab4daeff
c++: pack in requires-expr parm list [PR107417]

Here find_parameter_packs_r isn't detecting the pack T inside the
requires-expr's parameter list ultimately because cp_walk_trees
deliberately avoids walking the list so as to avoid false positives in
the unexpanded pack checker.

But it should still be fine to walk the TREE_TYPE of each parameter,
which we already need to do from for_each_template_parm_r, and is
sufficient to fix the testcase.

PR c++/107417

gcc/cp/ChangeLog:

* pt.cc (for_each_template_parm_r) <case REQUIRES_EXPR>: Move
walking of the TREE_TYPE of each parameter to ...
* tree.cc (cp_walk_subtrees) <case REQUIRES_EXPR>: ... here.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-requires33.C: New test.

(cherry picked from commit 079add3ad39d6620d34665dd9c26c21951eb657c)
gcc/cp/pt.cc
gcc/cp/tree.cc
gcc/testsuite/g++.dg/cpp2a/concepts-requires33.C [new file with mode: 0644]