From 2d91446123f8320796a7ad57de5d0a79dc69ea92 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 17 Aug 1998 18:46:43 +0000 Subject: [PATCH] decl.c (grokdeclarator): Catch parm with pointer to array of unknown bound here... * decl.c (grokdeclarator): Catch parm with pointer to array of unknown bound here... * method.c (process_overload_item): ...not here. From-SVN: r21800 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/decl.c | 5 +++++ gcc/cp/method.c | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 907b82ca77a..af531e9b75f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 1998-08-17 Jason Merrill + * decl.c (grokdeclarator): Catch parm with pointer to array of + unknown bound here... + * method.c (process_overload_item): ...not here. + * gxxint.texi: Remove obsolete documentation of overloading code. * decl.c (finish_enum): Also set TYPE_SIZE_UNIT. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 932fb694ad9..d6249a5ab9f 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9607,6 +9607,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) 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. */ diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 16ecbf2d7da..7084810dcbc 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -1241,7 +1241,7 @@ process_overload_item (parmtype, extra_Gcode) OB_PUTC ('A'); if (TYPE_DOMAIN (parmtype) == NULL_TREE) - error("pointer/reference to array of unknown bound in parm type"); + OB_PUTC ('_'); else { tree length = array_type_nelts (parmtype); -- 2.30.2