aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2007-11-19 16:35:13 -0500
committerJason Merrill <jason@gcc.gnu.org>2007-11-19 16:35:13 -0500
commit4009f2e7f047aafc40fc9a27d884497e87ae0c05 (patch)
tree1d16dbdc75464cebb92ce8862847635b43953c3f /gcc/c-common.c
parent4d4447b56b603b0786a0de3601ba45618dc6816c (diff)
downloadgcc-4009f2e7f047aafc40fc9a27d884497e87ae0c05.zip
gcc-4009f2e7f047aafc40fc9a27d884497e87ae0c05.tar.gz
gcc-4009f2e7f047aafc40fc9a27d884497e87ae0c05.tar.bz2
PR debug/29436, c/32326
PR debug/29436, c/32326 * tree.c (build_type_attribute_qual_variant): Refuse to make a distinct copy of a struct/enum type. Use build_distinct_type_copy. * doc/extend.texi (Type Attributes): Don't encourage people to add attributes to struct/enum types in a typedef. Fix transparent_union example. * tree-inline.c (remap_type_1): Remove code that's redundant with remap_type. (build_duplicate_type): Set id.copy_decl. * c-common.c (handle_transparent_union_attribute): Simplify logic. From-SVN: r130297
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 763745a..edc9b2c 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -5007,21 +5007,13 @@ handle_transparent_union_attribute (tree *node, tree name,
tree ARG_UNUSED (args), int flags,
bool *no_add_attrs)
{
- tree type = NULL;
+ tree type;
*no_add_attrs = true;
- if (DECL_P (*node))
- {
- if (TREE_CODE (*node) != TYPE_DECL)
- goto ignored;
- node = &TREE_TYPE (*node);
- type = *node;
- }
- else if (TYPE_P (*node))
- type = *node;
- else
- goto ignored;
+ if (TREE_CODE (*node) == TYPE_DECL)
+ node = &TREE_TYPE (*node);
+ type = *node;
if (TREE_CODE (type) == UNION_TYPE)
{