This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54984] [4.6/4.7/4.8 Regression] Array allocated with new in a template class is default initialised
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 26 Oct 2012 00:17:45 +0000
- Subject: [Bug c++/54984] [4.6/4.7/4.8 Regression] Array allocated with new in a template class is default initialised
- Auto-submitted: auto-generated
- References: <bug-54984-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54984
--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-26 00:17:45 UTC ---
And I'm testing the below, which appears almost obviously correct: essentially,
when build_new is passed a pointer to null pointer to VEC, it should not turn
the null pointer to VEC into an empty VEC!
Index: init.c
===================================================================
--- init.c (revision 192814)
+++ init.c (working copy)
@@ -2911,7 +2911,8 @@ build_new (VEC(tree,gc) **placement, tree type, tr
orig_placement = make_tree_vector_copy (*placement);
orig_nelts = nelts;
- orig_init = make_tree_vector_copy (*init);
+ if (*init)
+ orig_init = make_tree_vector_copy (*init);
make_args_non_dependent (*placement);
if (nelts)