/* 8.3.4/1: If the type of the identifier of D contains the auto
type-specifier, the program is ill-formed. */
- if (pedantic && type_uses_auto (type))
- pedwarn (input_location, OPT_Wpedantic,
- "declaration of %qD as array of %<auto%>", name);
+ if (type_uses_auto (type))
+ {
+ error ("%qD declared as array of %qT", name, type);
+ return error_mark_node;
+ }
/* If there are some types which cannot be array elements,
issue an error-message and return. */
&& (flag_iso || warn_vla > 0))
pedwarn (input_location, OPT_Wvla, "array of array of runtime bound");
- /* 8.3.4p1: ...if the type of the identifier of D contains the auto
- type-specifier, the program is ill-formed. */
- if (type_uses_auto (type))
- {
- error ("%qD declared as array of %qT", name, type);
- return error_mark_node;
- }
-
/* Figure out the index type for the array. */
if (size)
itype = compute_array_index_type (name, size, tf_warning_or_error);