diff options
author | Richard Guenther <rguenther@suse.de> | 2007-08-20 11:41:30 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-08-20 11:41:30 +0000 |
commit | ff7637ef1d8ab07702005ddba765a2d5fba4c071 (patch) | |
tree | 82bccf7f93eed5c6f4bbc884462c4c9ceb6ebe1d /gcc | |
parent | 5e2930c0923c19e195d83724eb6403f575bc8dbb (diff) | |
download | gcc-ff7637ef1d8ab07702005ddba765a2d5fba4c071.zip gcc-ff7637ef1d8ab07702005ddba765a2d5fba4c071.tar.gz gcc-ff7637ef1d8ab07702005ddba765a2d5fba4c071.tar.bz2 |
c-typeck.c (convert_for_assignment): Use the type of the member for the initialization.
2007-08-20 Richard Guenther <rguenther@suse.de>
* c-typeck.c (convert_for_assignment): Use the type of
the member for the initialization.
From-SVN: r127646
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-typeck.c | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4ce1dd6..35822ba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2007-08-20 Richard Guenther <rguenther@suse.de> + * c-typeck.c (convert_for_assignment): Use the type of + the member for the initialization. + +2007-08-20 Richard Guenther <rguenther@suse.de> + * c-objc-common.c (c_disregard_inline_limits): Remove. * c-objc-common.h (c_disregard_inline_limits): Likewise. * cgraphunit.c (cgraph_process_new_functions): Call diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index d793f72..3ef07b5 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); } } |