diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4ce1dd6c650..35822ba7e9f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-08-20 Richard Guenther + + * c-typeck.c (convert_for_assignment): Use the type of + the member for the initialization. + 2007-08-20 Richard Guenther * c-objc-common.c (c_disregard_inline_limits): Remove. diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index d793f72ab59..3ef07b5823e 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4039,6 +4039,7 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, if (pedantic && (!fundecl || !DECL_IN_SYSTEM_HEADER (fundecl))) pedwarn ("ISO C prohibits argument conversion to union type"); + rhs = fold_convert (TREE_TYPE (memb), rhs); return build_constructor_single (type, memb, rhs); } }