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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:5d3a05456dcc95e94c21977f4aa3260362f24e18

commit r11-9176-g5d3a05456dcc95e94c21977f4aa3260362f24e18
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Oct 20 08:38:58 2021 +0200

    c++: Fix up push_local_extern_decl_alias error recovery [PR102642]

    My recent push_local_extern_decl_alias change broke error-recovery,
    do_pushdecl can return error_mark_node and set_decl_tls_model can't be
    called on that.  There are other code paths that store error_mark_node
    into DECL_LOCAL_DECL_ALIAS, with the intent to differentiate the cases
    where we haven't yet tried to push it into the namespace scope (NULL)
    and one where we have tried it but it failed (error_mark_node), but looking
    around, there are other spots where we call functions or do processing
    which doesn't tolerate error_mark_node.

    So, the first hunk with the testcase fixes the testcase, the others
    fix what I've spotted and the fix was easy to figure out (there are I think
    3 other spots mainly for function multiversioning).

    2021-10-20  Jakub Jelinek  <ja...@redhat.com>

            PR c++/102642
            * name-lookup.c (push_local_extern_decl_alias): Don't call
            set_decl_tls_model on error_mark_node.
            * decl.c (make_rtl_for_nonlocal_decl): Don't call
            set_user_assembler_name on error_mark_node.
            * parser.c (cp_parser_oacc_declare): Ignore DECL_LOCAL_DECL_ALIAS
            if it is error_mark_node.
            (cp_parser_omp_declare_target): Likewise.

            * g++.dg/tls/pr102642.C: New test.

    (cherry picked from commit 424945258d1778617b5d3d5273f6e1c10e718f80)

Reply via email to