aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 2908224..1c8d497 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1952,7 +1952,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
if (!DECL_LANG_SPECIFIC (newdecl))
retrofit_lang_decl (newdecl);
- DECL_TLS_MODEL (newdecl) = DECL_TLS_MODEL (olddecl);
+ set_decl_tls_model (newdecl, DECL_TLS_MODEL (olddecl));
CP_DECL_THREADPRIVATE_P (newdecl) = 1;
}
}
@@ -8016,7 +8016,8 @@ grokvardecl (tree type,
if (decl_spec_seq_has_spec_p (declspecs, ds_thread))
{
- DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
+ if (DECL_EXTERNAL (decl) || TREE_PUBLIC (decl))
+ set_decl_tls_model (decl, decl_default_tls_model (decl));
if (declspecs->gnu_thread_keyword_p)
DECL_GNU_TLS_P (decl) = true;
}
@@ -10699,7 +10700,7 @@ grokdeclarator (const cp_declarator *declarator,
if (thread_p)
{
- DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
+ set_decl_tls_model (decl, decl_default_tls_model (decl));
if (declspecs->gnu_thread_keyword_p)
DECL_GNU_TLS_P (decl) = true;
}