PR c++/56772
* init.c (build_new): Don't try to process an array initializer
at template definition time.
From-SVN: r197326
2013-04-01 Jason Merrill <jason@redhat.com>
+ PR c++/56772
+ * init.c (build_new): Don't try to process an array initializer
+ at template definition time.
+
PR c++/56793
* typeck.c (finish_class_member_access_expr): Handle enum scope.
if (dependent_type_p (type)
|| any_type_dependent_arguments_p (*placement)
|| (nelts && type_dependent_expression_p (nelts))
+ || (nelts && *init)
|| any_type_dependent_arguments_p (*init))
return build_raw_new_expr (*placement, type, nelts, *init,
use_global_new);
--- /dev/null
+// PR c++/56772
+// { dg-require-effective-target c++11 }
+
+typedef __SIZE_TYPE__ size_t;
+void* operator new[](size_t, void *p) { return p; }
+template <typename T = size_t>
+void f ()
+{
+ size_t coord [2][2];
+ new (&coord) size_t [2][2]
+ {
+ {0,0},
+ {0,0},
+ };
+}
+
+int main ()
+{
+ f<>();
+}