From 33f4d7afa5aebc4d46f415479c0cb5d3aa871828 Mon Sep 17 00:00:00 2001 From: jason Date: Wed, 30 Mar 2011 18:06:52 +0000 Subject: [PATCH] * call.c (convert_like_real): Correct TREE_CONSTANT on CONSTRUCTOR. * decl.c (reshape_init_array_1): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171739 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/call.c | 2 ++ gcc/cp/decl.c | 2 ++ 3 files changed, 9 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 855844688b6..c282992ec83 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-03-30 Jason Merrill + + * call.c (convert_like_real): Correct TREE_CONSTANT on CONSTRUCTOR. + * decl.c (reshape_init_array_1): Likewise. + 2011-03-29 Jason Merrill PR c++/48265 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index a1cfa96e795..f7d108fffd8 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 16ccfaf5b69..d9c9ad80e65 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; -- 2.11.4.GIT