Commit b3faacfd by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

decl.c (create_array_type_for_decl): Check if NAME is NULL_TREE when displaying…

decl.c (create_array_type_for_decl): Check if NAME is NULL_TREE when displaying error message about missing array bounds.

	* decl.c (create_array_type_for_decl): Check if NAME is NULL_TREE
	when displaying error message about missing array bounds.

From-SVN: r47136
parent 873ff987
2001-11-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> 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, * mangle.c (write_expression): Handle CAST_EXPR, STATIC_CAST_EXPR,
CONST_CAST_EXPR. CONST_CAST_EXPR.
* operators.def: Add CAST_EXPR, STATIC_CAST_EXPR, CONST_CAST_EXPR. * operators.def: Add CAST_EXPR, STATIC_CAST_EXPR, CONST_CAST_EXPR.
......
...@@ -9476,8 +9476,11 @@ create_array_type_for_decl (name, type, size) ...@@ -9476,8 +9476,11 @@ create_array_type_for_decl (name, type, size)
can be omitted only for the first member of the sequence. */ can be omitted only for the first member of the sequence. */
if (TREE_CODE (type) == ARRAY_TYPE && !TYPE_DOMAIN (type)) 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", if (name)
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; return error_mark_node;
} }
......
// 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;
}
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