Commit 64d34897 by Jason Merrill Committed by Jason Merrill

re PR c++/59097 (ICE with invalid statement expression as array size)

	PR c++/59097
	* decl.c (compute_array_index_type): Don't call
	maybe_constant_value for a non-integral expression.

From-SVN: r207161
parent 5a21ca24
2014-01-27 Jason Merrill <jason@redhat.com>
PR c++/59097
* decl.c (compute_array_index_type): Don't call
maybe_constant_value for a non-integral expression.
2014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
* call.c (magic_varargs_p): Replaced flag_enable_cilkplus with
......
......@@ -8262,7 +8262,9 @@ compute_array_index_type (tree name, tree size, tsubst_flags_t complain)
abi_1_itype = error_mark_node;
}
size = maybe_constant_value (size);
if (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (type))
size = maybe_constant_value (size);
if (!TREE_CONSTANT (size))
size = osize;
}
......
// PR c++/59097
// { dg-options "" }
void foo()
{
int x[({ return; })]; // { dg-error "non-integral" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment