* decl.c (create_array_type_for_decl): Check if NAME is NULL_TREE
when displaying error message about missing array bounds.
From-SVN: r47136
2001-11-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+ * decl.c (create_array_type_for_decl): Check if NAME is NULL_TREE
+ when displaying error message about missing array bounds.
+
+2001-11-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
* mangle.c (write_expression): Handle CAST_EXPR, STATIC_CAST_EXPR,
CONST_CAST_EXPR.
* operators.def: Add CAST_EXPR, STATIC_CAST_EXPR, CONST_CAST_EXPR.
can be omitted only for the first member of the sequence. */
if (TREE_CODE (type) == ARRAY_TYPE && !TYPE_DOMAIN (type))
{
- cp_error ("declaration of `%D' as multidimensional array must have bounds for all dimensions except the first",
- name);
+ if (name)
+ cp_error ("declaration of `%D' as multidimensional array must have bounds for all dimensions except the first",
+ name);
+ else
+ cp_error ("multidimensional array must have bounds for all dimensions except the first");
return error_mark_node;
}
--- /dev/null
+// Test typeid of multidimensional array with no bounds.
+// { dg-do compile }
+
+#include <typeinfo>
+
+int main()
+{
+ const char *s = typeid(double[][]).name(); // { dg-error "bounds|confused" }
+ return 0;
+}