Commit afcf5b8e by Jason Merrill Committed by Jason Merrill

re PR c++/54511 (internal compiler error: in make_decl_rtl, at varasm.c:1147)

	PR c++/54511
	* pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.

From-SVN: r191262
parent 7c8233ce
2012-09-13 Jason Merrill <jason@redhat.com> 2012-09-13 Jason Merrill <jason@redhat.com>
PR c++/54511
* pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.
PR c++/53836 PR c++/53836
* pt.c (value_dependent_expression_p): A TREE_LIST initializer must * pt.c (value_dependent_expression_p): A TREE_LIST initializer must
be dependent. be dependent.
......
...@@ -10443,6 +10443,16 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) ...@@ -10443,6 +10443,16 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
break; break;
} }
if (TREE_CODE (t) == VAR_DECL && DECL_ANON_UNION_VAR_P (t))
{
/* Just use name lookup to find a member alias for an anonymous
union, but then add it to the hash table. */
r = lookup_name (DECL_NAME (t));
gcc_assert (DECL_ANON_UNION_VAR_P (r));
register_local_specialization (r, t);
break;
}
/* Create a new node for the specialization we need. */ /* Create a new node for the specialization we need. */
r = copy_decl (t); r = copy_decl (t);
if (type == NULL_TREE) if (type == NULL_TREE)
......
2012-09-13 Jason Merrill <jason@redhat.com> 2012-09-13 Jason Merrill <jason@redhat.com>
PR c++/54511
* g++.dg/template/anonunion2.C: New.
PR c++/53836 PR c++/53836
* g++.dg/template/init10.C: New. * g++.dg/template/init10.C: New.
......
template <int i>
struct S
{
S () { union { int a; }; a = 0; }
};
S<0> s;
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