summaryrefslogtreecommitdiff
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-21 05:49:35 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-21 05:49:35 +0000
commit8df5a43d64487d03b55a5799f17a6c465e019062 (patch)
tree3bec735a0f06546a748f8a6b206f44f1a8b31297 /gcc/c-typeck.c
parent7b2c73adda6f38cf47e61a5eede9f4c162ecc543 (diff)
downloadgcc-8df5a43d64487d03b55a5799f17a6c465e019062.tar.gz
* tree.h (TYPE_TRANSPARENT_UNION): Replace with ...
(TYPE_TRANSPARENT_AGGR): this, for union and record. * calls.c (initialize argument_information): Handle it. * c-common.c (handle_transparent_union_attribute): Use new name. * c-decl.c (finish_struct): Ditto. * c-typeck.c (type_lists_compatible_p): Ditto. (convert_for_assignment): Use new name and also handle record. * function.c (aggregate_value_p): Handle it. (pass_by_reference): Ditto. (assign_parm_data_types): Ditto. * print-tree.c (print_node): Ditto. * lto-streamer-in.c (unpack_ts_type_value_fields): Ditto. * lto-streamer-out.c (pack_ts_type_value_fields): Ditto. * tree.c (first_field): New fn. gcc/cp/ * mangle.c (write_type): Mangle transparent record as member type. * semantics.c (begin_class_definition): Recognize decimal classes and set TYPE_TRANSPARENT_AGGR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156106 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 17bdbf92b3b..567c2a51282 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1622,7 +1622,7 @@ type_lists_compatible_p (const_tree args1, const_tree args2,
and wait (union wait *) to be compatible. */
if (TREE_CODE (a1) == UNION_TYPE
&& (TYPE_NAME (a1) == 0
- || TYPE_TRANSPARENT_UNION (a1))
+ || TYPE_TRANSPARENT_AGGR (a1))
&& TREE_CODE (TYPE_SIZE (a1)) == INTEGER_CST
&& tree_int_cst_equal (TYPE_SIZE (a1),
TYPE_SIZE (a2)))
@@ -1643,7 +1643,7 @@ type_lists_compatible_p (const_tree args1, const_tree args2,
}
else if (TREE_CODE (a2) == UNION_TYPE
&& (TYPE_NAME (a2) == 0
- || TYPE_TRANSPARENT_UNION (a2))
+ || TYPE_TRANSPARENT_AGGR (a2))
&& TREE_CODE (TYPE_SIZE (a2)) == INTEGER_CST
&& tree_int_cst_equal (TYPE_SIZE (a2),
TYPE_SIZE (a1)))
@@ -5014,9 +5014,10 @@ convert_for_assignment (location_t location, tree type, tree rhs,
&& comptypes (type, rhstype))
return convert_and_check (type, rhs);
- /* Conversion to a transparent union from its member types.
+ /* Conversion to a transparent union or record from its member types.
This applies only to function arguments. */
- if (codel == UNION_TYPE && TYPE_TRANSPARENT_UNION (type)
+ if (((codel == UNION_TYPE || codel == RECORD_TYPE)
+ && TYPE_TRANSPARENT_AGGR (type))
&& errtype == ic_argpass)
{
tree memb, marginal_memb = NULL_TREE;