2012-10-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54984
* init.c (build_new): Don't turn a null *init into a pointer to
empty vector orig_init.
/testsuite
2012-10-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54984
* g++.dg/template/new11.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192846
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-10-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/54984
+ * init.c (build_new): Don't turn a null *init into a pointer to
+ empty vector orig_init.
+
2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53761
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)
+2012-10-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/54984
+ * g++.dg/template/new11.C: New.
+
2012-10-26 Richard Biener <rguenther@suse.de>
PR middle-end/54824
--- /dev/null
+// PR c++/54984
+// { dg-do run }
+
+int n = 1;
+
+void* operator new(__SIZE_TYPE__)
+{
+ n = -1;
+ return &n;
+}
+
+template <class T>
+struct Foo
+{
+ Foo()
+ : x(new int)
+ {
+ if (*x != -1)
+ __builtin_abort();
+ }
+
+ int* x;
+};
+
+int main()
+{
+ Foo<float> foo;
+}