OSDN Git Service

2007-08-20 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Aug 2007 11:41:30 +0000 (11:41 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Aug 2007 11:41:30 +0000 (11:41 +0000)
        * 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

gcc/ChangeLog
gcc/c-typeck.c

index 4ce1dd6..35822ba 100644 (file)
@@ -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
index d793f72..3ef07b5 100644 (file)
@@ -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);
        }
     }