aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/call.c2
-rw-r--r--gcc/cp/decl.c2
3 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8558446..c282992 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index a1cfa96..f7d108f 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 16ccfaf..d9c9ad8 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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;