summaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-18 15:06:41 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-18 15:06:41 +0000
commit914d11514337a01c76ea8aa46255d245c0fe367b (patch)
tree61f68b44485b32ef37f551799322a44f718c4370 /gcc/c-family
parent5b91c59ca06d073eb90e1a86a9d2264e16ab9dd3 (diff)
downloadgcc-914d11514337a01c76ea8aa46255d245c0fe367b.tar.gz
PR c++/35315
* c-common.c (handle_transparent_union_attribute): Don't make a duplicate type in C++. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171145 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-common.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index a0268fd5b5b..ca3db25b1cb 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+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>
* c-common.c (max_constexpr_depth): New.
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 6674c58ffab..799f8154936 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -6152,6 +6152,7 @@ handle_transparent_union_attribute (tree *node, tree name,
if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE))
{
if (TYPE_FIELDS (type) == NULL_TREE
+ || c_dialect_cxx ()
|| TYPE_MODE (type) != DECL_MODE (TYPE_FIELDS (type)))
goto ignored;