diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-21 14:27:46 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-21 14:27:46 +0000 |
commit | 0933e909587704975444287411b35c0c1deb05b9 (patch) | |
tree | 8b4db981fce7368eec77eb662d5ca0d416cfc72a /gcc/c-parse.in | |
parent | c8ae3bf0428943f65700a0a1aa4989467b683cdc (diff) | |
download | ppe42-gcc-0933e909587704975444287411b35c0c1deb05b9.tar.gz ppe42-gcc-0933e909587704975444287411b35c0c1deb05b9.zip |
* c-parse.in (fndef): Set DECL_SOURCE_LINE and FILE earlier.
(nested_function): Likewise.
(notype_nested_function): Likewise.
cp:
* pt.c (register_specialization): Update the decl's location,
if necessary.
(check_explicit_specialization): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67063 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r-- | gcc/c-parse.in | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 62a54f65665..477ae629fe7 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -434,12 +434,12 @@ fndef: all_prefix_attributes)) YYERROR1; } - old_style_parm_decls - { store_parm_decls (); } - save_filename save_lineno compstmt_or_error - { DECL_SOURCE_FILE (current_function_decl) = $7; - DECL_SOURCE_LINE (current_function_decl) = $8; - finish_function (0, 1); + old_style_parm_decls save_filename save_lineno + { DECL_SOURCE_FILE (current_function_decl) = $6; + DECL_SOURCE_LINE (current_function_decl) = $7; + store_parm_decls (); } + compstmt_or_error + { finish_function (0, 1); POP_DECLSPEC_STACK; } | declspecs_ts setspecs declarator error { POP_DECLSPEC_STACK; } @@ -448,12 +448,12 @@ fndef: all_prefix_attributes)) YYERROR1; } - old_style_parm_decls - { store_parm_decls (); } - save_filename save_lineno compstmt_or_error - { DECL_SOURCE_FILE (current_function_decl) = $7; - DECL_SOURCE_LINE (current_function_decl) = $8; - finish_function (0, 1); + old_style_parm_decls save_filename save_lineno + { DECL_SOURCE_FILE (current_function_decl) = $6; + DECL_SOURCE_LINE (current_function_decl) = $7; + store_parm_decls (); } + compstmt_or_error + { finish_function (0, 1); POP_DECLSPEC_STACK; } | declspecs_nots setspecs notype_declarator error { POP_DECLSPEC_STACK; } @@ -462,12 +462,12 @@ fndef: all_prefix_attributes)) YYERROR1; } - old_style_parm_decls - { store_parm_decls (); } - save_filename save_lineno compstmt_or_error - { DECL_SOURCE_FILE (current_function_decl) = $6; - DECL_SOURCE_LINE (current_function_decl) = $7; - finish_function (0, 1); + old_style_parm_decls save_filename save_lineno + { DECL_SOURCE_FILE (current_function_decl) = $5; + DECL_SOURCE_LINE (current_function_decl) = $6; + store_parm_decls (); } + compstmt_or_error + { finish_function (0, 1); POP_DECLSPEC_STACK; } | setspecs notype_declarator error { POP_DECLSPEC_STACK; } @@ -1593,18 +1593,19 @@ nested_function: } parsing_iso_function_signature = false; /* Don't warn about nested functions. */ } - old_style_parm_decls - { store_parm_decls (); } + old_style_parm_decls save_filename save_lineno + { tree decl = current_function_decl; + DECL_SOURCE_FILE (decl) = $4; + DECL_SOURCE_LINE (decl) = $5; + store_parm_decls (); } /* This used to use compstmt_or_error. That caused a bug with input `f(g) int g {}', where the use of YYERROR1 above caused an error which then was handled by compstmt_or_error. There followed a repeated execution of that same rule, which called YYERROR1 again, and so on. */ - save_filename save_lineno compstmt + compstmt { tree decl = current_function_decl; - DECL_SOURCE_FILE (decl) = $5; - DECL_SOURCE_LINE (decl) = $6; finish_function (1, 1); pop_function_context (); add_decl_stmt (decl); } @@ -1624,18 +1625,19 @@ notype_nested_function: } parsing_iso_function_signature = false; /* Don't warn about nested functions. */ } - old_style_parm_decls - { store_parm_decls (); } + old_style_parm_decls save_filename save_lineno + { tree decl = current_function_decl; + DECL_SOURCE_FILE (decl) = $4; + DECL_SOURCE_LINE (decl) = $5; + store_parm_decls (); } /* This used to use compstmt_or_error. That caused a bug with input `f(g) int g {}', where the use of YYERROR1 above caused an error which then was handled by compstmt_or_error. There followed a repeated execution of that same rule, which called YYERROR1 again, and so on. */ - save_filename save_lineno compstmt + compstmt { tree decl = current_function_decl; - DECL_SOURCE_FILE (decl) = $5; - DECL_SOURCE_LINE (decl) = $6; finish_function (1, 1); pop_function_context (); add_decl_stmt (decl); } |