re PR c++/55800 (Link failure with thread_local in unnamed namespace)
PR c++/55800 * decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable. From-SVN: r207360
This commit is contained in:
parent
f1f82a37ae
commit
99a82a1e16
|
@ -1,3 +1,8 @@
|
|||
2014-01-31 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/55800
|
||||
* decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable.
|
||||
|
||||
2014-01-31 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/59082
|
||||
|
|
|
@ -2949,7 +2949,7 @@ get_tls_init_fn (tree var)
|
|||
TREE_PUBLIC (fn) = TREE_PUBLIC (var);
|
||||
DECL_ARTIFICIAL (fn) = true;
|
||||
DECL_COMDAT (fn) = DECL_COMDAT (var);
|
||||
DECL_EXTERNAL (fn) = true;
|
||||
DECL_EXTERNAL (fn) = DECL_EXTERNAL (var);
|
||||
if (DECL_ONE_ONLY (var))
|
||||
make_decl_one_only (fn, cxx_comdat_group (fn));
|
||||
if (TREE_PUBLIC (var))
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
// PR c++/55800
|
||||
// { dg-options "-std=c++11" }
|
||||
// { dg-require-alias "" }
|
||||
// { dg-final { scan-assembler "_ZTH12foo_instance" { target tls_native } } }
|
||||
|
||||
struct foo
|
||||
{
|
||||
foo();
|
||||
};
|
||||
|
||||
thread_local foo foo_instance;
|
Loading…
Reference in New Issue