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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <[email protected]>:

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

commit r17-4153-gdcaafedee8a34f9ad60ac4d47ffe7529959028d2
Author: Jakub Jelinek <[email protected]>
Date:   Fri Sep 11 09:31:57 2026 +0200

    c++: Fix up tsubst_splice_expr [PR127276]

    The following testcase is incorrectly rejected.
    While when parsing the splice expressions outside of templates we call
    finish_id_expression -> finish_id_expression_1 -> convert_from_reference,
    in tsubst_splice_expr that doesn't happen and so build_x_array_ref is
    called with the PARM_DECLs of REFERENCE_TYPE rather than INDIRECT_REFs
    of those.

    The following patch adds the convert_from_reference call.

    2026-09-11  Jakub Jelinek  <[email protected]>

            PR c++/127276
            * pt.cc (tsubst_splice_expr): Call convert_from_reference if not
            member access and SPLICE_EXPR is a splice expression.

            * g++.dg/reflect/pr127276.C: New test.

    Reviewed-by: Jason Merrill <[email protected]>

Reply via email to