call.c (convert_like_real): Correct TREE_CONSTANT on CONSTRUCTOR.
authorJason Merrill <jason@redhat.com>
Wed, 30 Mar 2011 18:06:52 +0000 (14:06 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 30 Mar 2011 18:06:52 +0000 (14:06 -0400)
* call.c (convert_like_real): Correct TREE_CONSTANT on CONSTRUCTOR.
* decl.c (reshape_init_array_1): Likewise.

From-SVN: r171739

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/decl.c

index 855844688b66fdaec513e03648013f6aa405c3fa..c282992ec8339f83b76fe8ebccded0c37252e1f9 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-30  Jason Merrill  <jason@redhat.com>
+
+       * call.c (convert_like_real): Correct TREE_CONSTANT on CONSTRUCTOR.
+       * decl.c (reshape_init_array_1): Likewise.
+
 2011-03-29  Jason Merrill  <jason@redhat.com>
 
        PR c++/48265
index a1cfa96e795b4f9cb4e2ad8c1114ac612e6e208b..f7d108fffd89ea78874b3d401cf2337157302d64 100644 (file)
@@ -5481,6 +5481,8 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
            if (!BRACE_ENCLOSED_INITIALIZER_P (val))
              check_narrowing (TREE_TYPE (sub), val);
            CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (new_ctor), NULL_TREE, sub);
+           if (!TREE_CONSTANT (sub))
+             TREE_CONSTANT (new_ctor) = false;
          }
        /* Build up the array.  */
        elttype = cp_build_qualified_type
index 16ccfaf5b69b43f77f3281b1136e492c8f82e5a1..d9c9ad80e65c16b091b1e989f8df8a331f6ca2db 100644 (file)
@@ -4905,6 +4905,8 @@ reshape_init_array_1 (tree elt_type, tree max_index, reshape_iter *d)
        return error_mark_node;
       CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (new_init),
                              size_int (index), elt_init);
+      if (!TREE_CONSTANT (elt_init))
+       TREE_CONSTANT (new_init) = false;
     }
 
   return new_init;