[Bug c++/86355] [9/10/11/12 Regression] Internal compiler error with pack expansion and fold expression

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu May 27 17:42:25 GMT 2021


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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:db79713150f4f8b6ff3de81d00d92578679e0e65

commit r12-1094-gdb79713150f4f8b6ff3de81d00d92578679e0e65
Author: Jason Merrill <jason@redhat.com>
Date:   Wed May 26 17:38:42 2021 -0400

    c++: argument pack with expansion [PR86355]

    This testcase revealed that we were using PACK_EXPANSION_EXTRA_ARGS a lot
    more than necessary; use_pack_expansion_extra_args_p meant to use it in the
    case of corresponding arguments in different argument packs differing in
    whether they are pack expansions, but it was mistakenly also returning true
    for the case of a single argument pack containing both expansion and
    non-expansion elements.

    Surprisingly, just disabling that didn't lead to any regressions in the
    testsuite; it seems other changes have prevented us getting to this point
    for code that used to exercise it.  So this patch limits the check to
    arguments in the same position in the packs, and asserts that we never
    actually see a mismatch.

            PR c++/86355

    gcc/cp/ChangeLog:

            * pt.c (use_pack_expansion_extra_args_p): Don't compare
            args from the same argument pack.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/alias-decl-variadic2.C: New test.


More information about the Gcc-bugs mailing list