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

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

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

commit r16-3120-gaf31db6461110dfb81efaf2a287327226ae5a7a8
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Mon Aug 11 08:53:26 2025 +0200

    c++: Fix structured binding redeclaration error recovery [PR121442]

    My C++26 P2686R4 PR117784 caused ICE on the following testcase.
    While the earlier conditions guarantee decl2 is not error_mark_node,
    decl can be (that is used when something erroneous has been seen earlier
    and the whole structured bindings will be ignored after parsing).

    So, the following patch avoids the copying of constexpr/constinit flags
    if decl is error_mark_node.

    2025-08-11  Jakub Jelinek  <ja...@redhat.com>

            PR c++/121442
            * parser.cc (cp_parser_decomposition_declaration): Don't copy
            DECL_DECLARED_CONST{EXPR,INIT}_P bits from decl to decl2 if
            decl is error_mark_node.

            * g++.dg/cpp1z/decomp65.C: New test.

Reply via email to