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

--- Comment #7 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:5fec46a0b4a94190209c81f4091a0369a056727d

commit r11-9073-g5fec46a0b4a94190209c81f4091a0369a056727d
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Fri Oct 1 10:30:16 2021 +0200

    c++: Fix handling of __thread/thread_local extern vars declared at function
scope [PR102496]

    The introduction of push_local_extern_decl_alias in
    r11-3699-g4e62aca0e0520e4ed2532f2d8153581190621c1a
    broke tls vars, while the decl they are created for has the tls model
    set properly, nothing sets it for the alias that is actually used,
    so accesses to it are done as if they were normal variables.
    This is then diagnosed at link time if the definition of the extern
    vars is __thread/thread_local.

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

            PR c++/102496
            * name-lookup.c (push_local_extern_decl_alias): Return early even
for
            tls vars with non-dependent type when processing_template_decl. 
For
            CP_DECL_THREAD_LOCAL_P vars call set_decl_tls_model on alias.

            * g++.dg/tls/pr102496-1.C: New test.
            * g++.dg/tls/pr102496-2.C: New test.

    (cherry picked from commit 701075864ac4d1c6cec936d10f9cfc2aeb8c1699)
  • [Bug c++/102496] [11 regression... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to