mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-08 19:20:44 +08:00
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
This commit is contained in:
parent
3807059e82
commit
0f59a31da8
@ -1,5 +1,9 @@
|
||||
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. */
|
||||
|
11
gcc/testsuite/g++.dg/cpp0x/nsdmi-union5.C
Normal file
11
gcc/testsuite/g++.dg/cpp0x/nsdmi-union5.C
Normal file
@ -0,0 +1,11 @@
|
||||
// PR c++/58701
|
||||
// { dg-require-effective-target c++11 }
|
||||
// { dg-final { scan-assembler "7" } }
|
||||
|
||||
static union
|
||||
{
|
||||
union
|
||||
{
|
||||
int i = 7;
|
||||
};
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user