1998-08-17 Jason Merrill <jason@yorick.cygnus.com>
+ * decl.c (grokparms): No, here.
+
* decl.c (grokdeclarator): Catch parm with pointer to array of
unknown bound here...
* method.c (process_overload_item): ...not here.
type = TREE_TYPE (type);
}
- if (decl_context == PARM && TREE_CODE (type) == ARRAY_TYPE
- && TYPE_DOMAIN (type) == NULL_TREE)
- cp_error ("parameter type includes pointer to array of unknown bound `%T'",
- type);
-
/* Merge any constancy or volatility into the target type
for the pointer. */
signature_error (decl, type);
any_error = 1; /* Seems like a good idea. */
}
+ else if (POINTER_TYPE_P (type))
+ {
+ tree t = type;
+ while (POINTER_TYPE_P (t)
+ || (TREE_CODE (t) == ARRAY_TYPE
+ && TYPE_DOMAIN (t) != NULL_TREE))
+ t = TREE_TYPE (t);
+ if (TREE_CODE (t) == ARRAY_TYPE)
+ cp_error ("parameter type `%T' includes pointer to array of unknown bound",
+ type);
+ }
}
if (TREE_CODE (decl) == VOID_TYPE)