Commit 6962711f by Jason Merrill Committed by Jason Merrill

re PR c++/58672 ([c++11] ICE with thread_local and variable of broken class)

	PR c++/58672
	* decl2.c (handle_tls_init): Handle null init fn.

From-SVN: r207363
parent 99a82a1e
2014-01-31 Jason Merrill <jason@redhat.com>
PR c++/58672
* decl2.c (handle_tls_init): Handle null init fn.
PR c++/55800
* decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable.
......
......@@ -4036,6 +4036,8 @@ handle_tls_init (void)
if (TREE_PUBLIC (var))
{
tree single_init_fn = get_tls_init_fn (var);
if (single_init_fn == NULL_TREE)
continue;
cgraph_node *alias
= cgraph_same_body_alias (cgraph_get_create_node (fn),
single_init_fn, fn);
......
// PR c++/58672
// { dg-options "-std=c++11" }
// { dg-require-effective-target tls }
struct A
{
A(int);
i; // { dg-error "" }
};
thread_local A a(0);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment