PR c++/48531
* init.c (build_value_init_noctor): Check complain consistently.
From-SVN: r172434
2011-04-14 Jason Merrill <jason@redhat.com>
+ PR c++/48531
+ * init.c (build_value_init_noctor): Check complain consistently.
+
PR c++/48557
* typeck.c (cp_build_binary_op): Don't decay void operands.
as we don't know the size of the array yet. */
if (max_index == error_mark_node)
{
- error ("cannot value-initialize array of unknown bound %qT", type);
+ if (complain & tf_error)
+ error ("cannot value-initialize array of unknown bound %qT",
+ type);
return error_mark_node;
}
gcc_assert (TREE_CODE (max_index) == INTEGER_CST);
2011-04-14 Jason Merrill <jason@redhat.com>
+ * g++.dg/cpp0x/sfinae15.C: New.
+
* g++.dg/cpp0x/sfinae14.C: New.
* g++.dg/ext/vla10.C: New.
--- /dev/null
+// PR c++/48531
+// { dg-options -std=c++0x }
+
+template<class T,
+ class = decltype(T())
+>
+char f(int);
+
+template<class>
+char (&f(...))[2];
+
+static_assert(sizeof(f<int[]>(0)) != 1, "Error");