Commit 0f59a31d by Jason Merrill Committed by Jason Merrill

re PR c++/58701 ([c++11] ICE initializing member of static union)

	PR c++/58701
	* semantics.c (build_anon_member_initialization): Stop walking
	when we run out of COMPONENT_REFs.

From-SVN: r207209
parent 3807059e
2014-01-28 Jason Merrill <jason@redhat.com>
PR c++/58701
* semantics.c (build_anon_member_initialization): Stop walking
when we run out of COMPONENT_REFs.
PR c++/58632
* decl.c (lookup_and_check_tag): Ignore template parameters if
scope == ts_current.
......
......@@ -7515,7 +7515,8 @@ build_anon_member_initialization (tree member, tree init,
fields.safe_push (TREE_OPERAND (member, 1));
member = TREE_OPERAND (member, 0);
}
while (ANON_AGGR_TYPE_P (TREE_TYPE (member)));
while (ANON_AGGR_TYPE_P (TREE_TYPE (member))
&& TREE_CODE (member) == COMPONENT_REF);
/* VEC has the constructor elements vector for the context of FIELD.
If FIELD is an anonymous aggregate, we will push inside it. */
......
// PR c++/58701
// { dg-require-effective-target c++11 }
// { dg-final { scan-assembler "7" } }
static union
{
union
{
int i = 7;
};
};
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