summaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-23 02:56:43 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-23 02:56:43 +0000
commit00fe10b0093a5cb120088dd7363e2177d0fed07d (patch)
tree104ca237a73f6dec8df341cec422f6c96656b042 /gcc/cp/init.c
parent20715b9c39e3a65de5e0960e7312d4f6800bad83 (diff)
downloadgcc-00fe10b0093a5cb120088dd7363e2177d0fed07d.tar.gz
2006-08-21 Andrew Pinski <pinskia@physics.uc.edu>
PR C++/28450 * cp/init.c (build_zero_init): Handle VECTOR_TYPE and COMPLEX_TYPEs. 2006-08-21 Andrew Pinski <pinskia@physics.uc.edu> PR C++/28450 * g++.dg/ext/vector4.C: New test. * g++.dg/ext/complex1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116341 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index ff6de3360e5..a88d0c06703 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -178,7 +178,8 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
items with static storage duration that are not otherwise
initialized are initialized to zero. */
;
- else if (SCALAR_TYPE_P (type))
+ else if (SCALAR_TYPE_P (type)
+ || TREE_CODE (type) == COMPLEX_TYPE)
init = convert (type, integer_zero_node);
else if (CLASS_TYPE_P (type))
{
@@ -248,6 +249,8 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
/* Build a constructor to contain the initializations. */
init = build_constructor (type, v);
}
+ else if (TREE_CODE (type) == VECTOR_TYPE)
+ init = fold_convert (type, integer_zero_node);
else
gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);