]> gcc.gnu.org Git - gcc.git/commit
c++: unifying equal NONTYPE_ARGUMENT_PACKs [PR102547]
authorPatrick Palka <ppalka@redhat.com>
Tue, 5 Oct 2021 19:35:21 +0000 (15:35 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 6 Oct 2021 13:43:15 +0000 (09:43 -0400)
commit1aef951f1aa0b50a8da12f6fe6e80f3fdaa4d98e
treee81a43b4d84836465f9505714d17fb297b0dd441
parentd80c0e4584acc204ca9a2f8880ad455fef48371f
c++: unifying equal NONTYPE_ARGUMENT_PACKs [PR102547]

Here during partial ordering of the two partial specializations we end
up in unify with parm=arg=NONTYPE_ARGUMENT_PACK<V0, V1>, and crash shortly
thereafter because uses_template_parms(parms) calls potential_const_expr
which doesn't handle NONTYPE_ARGUMENT_PACK.

This patch fixes this by extending potential_constant_expression to handle
NONTYPE_ARGUMENT_PACK appropriately.

PR c++/102547

gcc/cp/ChangeLog:

* constexpr.c (potential_constant_expression_1): Handle
NONTYPE_ARGUMENT_PACK.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/variadic-partial2.C: New test.
* g++.dg/cpp0x/variadic-partial2a.C: New test.

(cherry picked from commit d4c470c376b4cb82c9a0b7e8a4b88c44d5e4289d)
gcc/cp/constexpr.c
gcc/testsuite/g++.dg/cpp0x/variadic-partial2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/variadic-partial2a.C [new file with mode: 0644]
This page took 0.068762 seconds and 6 git commands to generate.