summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-04 00:55:44 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-04 00:55:44 +0000
commit0138a8eac7140b5ed82cea9aff22699717a49ff3 (patch)
tree8f22a14efe384a57398c117ace7f9749ab014175 /gcc/cp
parent7abd84e4f4fae2dee8d91ffada89523ac89d73d4 (diff)
downloadgcc-0138a8eac7140b5ed82cea9aff22699717a49ff3.tar.gz
Core 1270
* call.c (build_aggr_conv): Call reshape_init. (convert_like_real): Likewise. * typeck2.c (process_init_constructor): Clear TREE_CONSTANT if not all constant. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184876 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/call.c5
-rw-r--r--gcc/cp/typeck2.c5
3 files changed, 15 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index df39779475c..f1eb802f9c1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
2012-03-03 Jason Merrill <jason@redhat.com>
+ Core 1270
+ * call.c (build_aggr_conv): Call reshape_init.
+ (convert_like_real): Likewise.
+ * typeck2.c (process_init_constructor): Clear TREE_CONSTANT if
+ not all constant.
+
* mangle.c (write_nested_name): Use decl_mangling_context.
(write_prefix, write_template_prefix): Likewise.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index c962ca0bd53..8baad827f6d 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -886,6 +886,10 @@ build_aggr_conv (tree type, tree ctor, int flags)
tree field = next_initializable_field (TYPE_FIELDS (type));
tree empty_ctor = NULL_TREE;
+ ctor = reshape_init (type, ctor, tf_none);
+ if (ctor == error_mark_node)
+ return NULL;
+
for (; field; field = next_initializable_field (DECL_CHAIN (field)))
{
tree ftype = TREE_TYPE (field);
@@ -5795,6 +5799,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
expr = build2 (COMPLEX_EXPR, totype, real, imag);
return fold_if_not_in_template (expr);
}
+ expr = reshape_init (totype, expr, complain);
return get_target_expr (digest_init (totype, expr, complain));
default:
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index a2606f17abb..974f92ff89c 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1392,7 +1392,10 @@ process_init_constructor (tree type, tree init, tsubst_flags_t complain)
TREE_TYPE (init) = type;
if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type) == NULL_TREE)
cp_complete_array_type (&TREE_TYPE (init), init, /*do_default=*/0);
- if (!(flags & PICFLAG_NOT_ALL_CONSTANT))
+ if (flags & PICFLAG_NOT_ALL_CONSTANT)
+ /* Make sure TREE_CONSTANT isn't set from build_constructor. */
+ TREE_CONSTANT (init) = false;
+ else
{
TREE_CONSTANT (init) = 1;
if (!(flags & PICFLAG_NOT_ALL_SIMPLE))