aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-08-17 19:29:45 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-08-17 15:29:45 -0400
commit482b883f893a6e350ff801a06e20785c03d380c3 (patch)
tree006e6d2ad092d4645343009ce1ca4382eb54499f /gcc
parent2d91446123f8320796a7ad57de5d0a79dc69ea92 (diff)
downloadgcc-482b883f893a6e350ff801a06e20785c03d380c3.zip
gcc-482b883f893a6e350ff801a06e20785c03d380c3.tar.gz
gcc-482b883f893a6e350ff801a06e20785c03d380c3.tar.bz2
* decl.c (grokparms): No, here.
From-SVN: r21801
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog2
-rw-r--r--gcc/cp/decl.c16
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index af531e9..aff2314 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,7 @@
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.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d6249a5..e46de42 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9607,11 +9607,6 @@ 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. */
@@ -10825,6 +10820,17 @@ grokparms (first_parm, funcdef_flag)
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)