On 06/11/2012 12:11 PM, Florian Weimer wrote:
+      tree inner_nelts_cst = maybe_constant_value (inner_nelts);
+      if (!TREE_CONSTANT (inner_nelts_cst))
+       {
+         if (complain & tf_error)
+           error_at (EXPR_LOC_OR_HERE (inner_nelts),
+                     "array size in operator new must be constant");

Please use cxx_constant_value to give a more specific error about what is non-constant.

+  /* Warn if we performed the (T[N]) to T[N] transformation and N is
+     variable.  */
+  if (outer_nelts_from_type
+      && !TREE_CONSTANT (maybe_constant_value (outer_nelts))
+      && (complain & tf_warning_or_error))
+    pedwarn(EXPR_LOC_OR_HERE (outer_nelts), OPT_Wvla,
+           "ISO C++ does not support variable-length array types");

Here, if we aren't complaining we should return error_mark_node; we always need to act pedantic in SFINAE context.

Jason

Reply via email to