diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-02-15 18:09:18 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-02-15 18:09:18 +0100 |
commit | 4f5e5fcba8a9cbabb0e05f9cb753b549396bc2de (patch) | |
tree | eedc04635f147eb5c3a44a73db1298a990093775 /gcc/cp | |
parent | 1eb08f5270794aa13b1f8cfa98c9323914b3011a (diff) | |
download | gcc-4f5e5fcba8a9cbabb0e05f9cb753b549396bc2de.zip gcc-4f5e5fcba8a9cbabb0e05f9cb753b549396bc2de.tar.gz gcc-4f5e5fcba8a9cbabb0e05f9cb753b549396bc2de.tar.bz2 |
re PR c++/79288 (TLS model wrong for static data members since r241137)
PR c++/79288
* decl.c (grokdeclarator): For static data members, handle thread_p
only after handling inline.
* g++.dg/tls/pr79288.C: New test.
From-SVN: r245488
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 17 |
2 files changed, 15 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7b94d3b..74f5fc9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-02-15 Jakub Jelinek <jakub@redhat.com> + + PR c++/79288 + * decl.c (grokdeclarator): For static data members, handle thread_p + only after handling inline. + 2017-02-14 Marek Polacek <polacek@redhat.com> PR c++/79420 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 2292a3a..353e7b5 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -12063,14 +12063,6 @@ grokdeclarator (const cp_declarator *declarator, : input_location, VAR_DECL, unqualified_id, type); set_linkage_for_static_data_member (decl); - if (thread_p) - { - CP_DECL_THREAD_LOCAL_P (decl) = true; - if (!processing_template_decl) - set_decl_tls_model (decl, decl_default_tls_model (decl)); - if (declspecs->gnu_thread_keyword_p) - SET_DECL_GNU_TLS_P (decl); - } if (concept_p) error ("static data member %qE declared %<concept%>", unqualified_id); @@ -12091,6 +12083,15 @@ grokdeclarator (const cp_declarator *declarator, definition is provided, unless this is an inline variable. */ DECL_EXTERNAL (decl) = 1; + + if (thread_p) + { + CP_DECL_THREAD_LOCAL_P (decl) = true; + if (!processing_template_decl) + set_decl_tls_model (decl, decl_default_tls_model (decl)); + if (declspecs->gnu_thread_keyword_p) + SET_DECL_GNU_TLS_P (decl); + } } else { |