[Bug c++/122169] Qualifiers (const/volatile) added to a type pack index is lost

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 5 14:14:03 GMT 2026


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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:6385a3582c0b6b30479bc68f7d2b74e327ec44d7

commit r16-7329-g6385a3582c0b6b30479bc68f7d2b74e327ec44d7
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Feb 5 09:13:42 2026 -0500

    c++: cv-qualified pack index propagation [PR122169]

    Since type pack indexes can be cv-qualified, we need to propagate their
    qualifiers when substituting them.

            PR c++/122169

    gcc/cp/ChangeLog:

            * pt.cc (tsubst_pack_index): Propagate cv-qualifiers of
            PACK_INDEX_TYPE.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp26/pack-indexing19.C: New test.

    Reviewed-by: Marek Polacek <polacek@redhat.com>
    Reviewed-by: Jason Merrill <jason@redhat.com>


More information about the Gcc-bugs mailing list