Commit 82d37118 by Jason Merrill Committed by Jason Merrill

re PR c++/35315 (ICE with attribute transparent_union)

	PR c++/35315
	* c-common.c (handle_transparent_union_attribute): Don't
	make a duplicate type in C++.

From-SVN: r171145
parent 09a52fc3
2011-03-18 Jason Merrill <jason@redhat.com>
PR c++/35315
* c-common.c (handle_transparent_union_attribute): Don't
make a duplicate type in C++.
2011-03-15 Jason Merrill <jason@redhat.com> 2011-03-15 Jason Merrill <jason@redhat.com>
* c-common.c (max_constexpr_depth): New. * c-common.c (max_constexpr_depth): New.
......
...@@ -6152,6 +6152,7 @@ handle_transparent_union_attribute (tree *node, tree name, ...@@ -6152,6 +6152,7 @@ handle_transparent_union_attribute (tree *node, tree name,
if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE))
{ {
if (TYPE_FIELDS (type) == NULL_TREE if (TYPE_FIELDS (type) == NULL_TREE
|| c_dialect_cxx ()
|| TYPE_MODE (type) != DECL_MODE (TYPE_FIELDS (type))) || TYPE_MODE (type) != DECL_MODE (TYPE_FIELDS (type)))
goto ignored; goto ignored;
......
2011-03-18 Jason Merrill <jason@redhat.com>
* g++.dg/ext/attrib32.C: Expect errors on the two-names case.
2011-03-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2011-03-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR middle-end/47405 PR middle-end/47405
......
...@@ -10,10 +10,10 @@ void bar() ...@@ -10,10 +10,10 @@ void bar()
foo(0); foo(0);
} }
typedef union U1 { int i; } U2 __attribute__((transparent_union)); typedef union U1 { int i; } U2 __attribute__((transparent_union)); // { dg-warning "ignored" }
static void foo2(U1) {} static void foo2(U1) {} // { dg-error "previously defined" }
static void foo2(U2) {} static void foo2(U2) {} // { dg-error "redefinition" }
void bar2(U1 u1, U2 u2) void bar2(U1 u1, U2 u2)
{ {
......
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