diff options
author | Jason Merrill <jason@redhat.com> | 2022-03-27 09:44:59 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-03-28 09:35:58 -0400 |
commit | 8796eb27e24bd3340ebd393e96a94b91d09407e9 (patch) | |
tree | 1fc2a9385e5994b8e5fd5e95ad249821750198d1 /gcc/cp/name-lookup.cc | |
parent | b854ce130ebbfdf2f882ef08538746030513b44b (diff) | |
download | gcc-8796eb27e24bd3340ebd393e96a94b91d09407e9.zip gcc-8796eb27e24bd3340ebd393e96a94b91d09407e9.tar.gz gcc-8796eb27e24bd3340ebd393e96a94b91d09407e9.tar.bz2 |
c++: visibility of local extern [PR103291]
When setting up the hidden namespace-scope decl for a local extern, we also
need to set its visibility.
PR c++/103291
gcc/cp/ChangeLog:
* name-lookup.cc (push_local_extern_decl_alias): Call
determine_visibility.
gcc/testsuite/ChangeLog:
* g++.dg/ext/visibility/visibility-local-extern1.C: New test.
Diffstat (limited to 'gcc/cp/name-lookup.cc')
-rw-r--r-- | gcc/cp/name-lookup.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc index 3c7b626..c833b84 100644 --- a/gcc/cp/name-lookup.cc +++ b/gcc/cp/name-lookup.cc @@ -3476,6 +3476,9 @@ push_local_extern_decl_alias (tree decl) && CP_DECL_THREAD_LOCAL_P (decl) && alias != error_mark_node) set_decl_tls_model (alias, DECL_TLS_MODEL (decl)); + + /* Adjust visibility. */ + determine_visibility (alias); } } |