summaryrefslogtreecommitdiff
path: root/gcc/c-parse.in
diff options
context:
space:
mode:
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2002-01-24 01:32:12 +0000
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2002-01-24 01:32:12 +0000
commitbc3195ce145bf8af09dec6089a24d9b7b624a9d6 (patch)
tree620c5fbe63c388e10a6c46213da70ace21421ee0 /gcc/c-parse.in
parent8eb1b04c0e541624c74f38b5b6dc66aa07d0531d (diff)
downloadgcc-bc3195ce145bf8af09dec6089a24d9b7b624a9d6.tar.gz
2002-01-16 Aldy Hernandez <aldyh@redhat.com>
* c-parse.in (parmlist_or_identifiers): Add maybe_attribute. (parmlist_or_identifiers_1): Verify that only a parmlist follows an attribute. * gcc.dg/20020115-1.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49161 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r--gcc/c-parse.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 9434a2fa9ff..524d407e801 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -2605,11 +2605,12 @@ setspecs_fp:
where either a parmlist or an identifier list is ok.
Its value is a list of ..._TYPE nodes or a list of identifiers. */
parmlist_or_identifiers:
+ maybe_attribute
{ pushlevel (0);
clear_parm_order ();
declare_parm_level (1); }
parmlist_or_identifiers_1
- { $$ = $2;
+ { $$ = $3;
parmlist_tags_warning ();
poplevel (0, 0, 0); }
;
@@ -2621,7 +2622,15 @@ parmlist_or_identifiers_1:
for (t = $1; t; t = TREE_CHAIN (t))
if (TREE_VALUE (t) == NULL_TREE)
error ("`...' in old-style identifier list");
- $$ = tree_cons (NULL_TREE, NULL_TREE, $1); }
+ $$ = tree_cons (NULL_TREE, NULL_TREE, $1);
+
+ /* Make sure we have a parmlist after attributes. */
+ if ($<ttype>-1 != 0
+ && (TREE_CODE ($$) != TREE_LIST
+ || TREE_PURPOSE ($$) == 0
+ || TREE_CODE (TREE_PURPOSE ($$)) != PARM_DECL))
+ YYERROR1;
+ }
;
/* A nonempty list of identifiers. */