Commit 866890d9 by Richard Kenner

(fndef, nested_function, notype_nested_function): Support attributes

after function definition.

From-SVN: r9942
parent 95f29160
...@@ -27,10 +27,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ...@@ -27,10 +27,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
written by AT&T, but I have never seen it. */ written by AT&T, but I have never seen it. */
ifobjc ifobjc
%expect 48 %expect 53
end ifobjc end ifobjc
ifc ifc
%expect 34 %expect 39
/* These are the 23 conflicts you should get in parse.output; /* These are the 23 conflicts you should get in parse.output;
the state numbers may vary if minor changes in the grammar are made. the state numbers may vary if minor changes in the grammar are made.
...@@ -338,8 +338,8 @@ datadef: ...@@ -338,8 +338,8 @@ datadef:
; ;
fndef: fndef:
typed_declspecs setspecs declarator typed_declspecs setspecs declarator maybe_attribute
{ if (! start_function ($1, $3, prefix_attributes, 0)) { if (! start_function ($1, $3, prefix_attributes, $4, 0))
YYERROR1; YYERROR1;
reinit_parse_for_function (); } reinit_parse_for_function (); }
xdecls xdecls
...@@ -355,8 +355,8 @@ fndef: ...@@ -355,8 +355,8 @@ fndef:
prefix_attributes = TREE_PURPOSE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary ($2); } resume_momentary ($2); }
| declmods setspecs notype_declarator | declmods setspecs notype_declarator maybe_attribute
{ if (! start_function ($1, $3, prefix_attributes, 0)) { if (! start_function ($1, $3, prefix_attributes, $4, 0))
YYERROR1; YYERROR1;
reinit_parse_for_function (); } reinit_parse_for_function (); }
xdecls xdecls
...@@ -372,8 +372,9 @@ fndef: ...@@ -372,8 +372,9 @@ fndef:
prefix_attributes = TREE_PURPOSE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary ($2); } resume_momentary ($2); }
| setspecs notype_declarator | setspecs notype_declarator maybe_attribute
{ if (! start_function (NULL_TREE, $2, prefix_attributes, 0)) { if (! start_function (NULL_TREE, $2,
prefix_attributes, $3, 0))
YYERROR1; YYERROR1;
reinit_parse_for_function (); } reinit_parse_for_function (); }
xdecls xdecls
...@@ -1217,10 +1218,10 @@ end ifc ...@@ -1217,10 +1218,10 @@ end ifc
; ;
nested_function: nested_function:
declarator declarator maybe_attribute
{ push_c_function_context (); { push_c_function_context ();
if (! start_function (current_declspecs, $1, if (! start_function (current_declspecs, $1,
prefix_attributes, 1)) prefix_attributes, $2, 1))
{ {
pop_c_function_context (); pop_c_function_context ();
YYERROR1; YYERROR1;
...@@ -1240,10 +1241,10 @@ nested_function: ...@@ -1240,10 +1241,10 @@ nested_function:
; ;
notype_nested_function: notype_nested_function:
notype_declarator notype_declarator maybe_attribute
{ push_c_function_context (); { push_c_function_context ();
if (! start_function (current_declspecs, $1, if (! start_function (current_declspecs, $1,
prefix_attributes, 1)) prefix_attributes, $2, 1))
{ {
pop_c_function_context (); pop_c_function_context ();
YYERROR1; YYERROR1;
......
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