summaryrefslogtreecommitdiffstats
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-20 11:41:30 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-20 11:41:30 +0000
commit032987e98aa0513d8978c2725dee4b8dcca968bf (patch)
tree82bccf7f93eed5c6f4bbc884462c4c9ceb6ebe1d /gcc/c-typeck.c
parent095878eb6bb5245f0aec3260700ec6d449267f00 (diff)
downloadppe42-gcc-032987e98aa0513d8978c2725dee4b8dcca968bf.tar.gz
ppe42-gcc-032987e98aa0513d8978c2725dee4b8dcca968bf.zip
2007-08-20 Richard Guenther <rguenther@suse.de>
* c-typeck.c (convert_for_assignment): Use the type of the member for the initialization. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127646 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c1
1 files changed, 1 insertions, 0 deletions
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);
}
}
OpenPOWER on IntegriCloud