aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2006-05-19 16:04:22 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2006-05-19 16:04:22 +0000
commiteaf6fb906eb9e8807f068dd917a738523382bfe2 (patch)
tree87a70819ab712edee728af13b2ec95fe70702bdf /gcc/cp/parser.c
parentaffaef6e07c544cef985d95e213b6942fe1988da (diff)
downloadgcc-eaf6fb906eb9e8807f068dd917a738523382bfe2.zip
gcc-eaf6fb906eb9e8807f068dd917a738523382bfe2.tar.gz
gcc-eaf6fb906eb9e8807f068dd917a738523382bfe2.tar.bz2
re PR c++/26433 (Syntax error using __FUNCTION__ in catch handler)
PR c++/26433 * cp-tree.h (begin_function_try_block): Change prototype. (finish_function_handler_sequence): Likewise. * parser.c (cp_parser_function_try_block): Adjust calls. * pt.c (tsubst_expr): Adjust calls. * semantics.c (begin_function_try_block): Create an artificial outer scope. (finish_function_handler_sequence): Close it. PR c++/26433 * g++.dg/template/fntry1.C: New test. From-SVN: r113911
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index e80b8ee..74934fb 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -14225,6 +14225,7 @@ cp_parser_try_block (cp_parser* parser)
static bool
cp_parser_function_try_block (cp_parser* parser)
{
+ tree compound_stmt;
tree try_block;
bool ctor_initializer_p;
@@ -14232,7 +14233,7 @@ cp_parser_function_try_block (cp_parser* parser)
if (!cp_parser_require_keyword (parser, RID_TRY, "`try'"))
return false;
/* Let the rest of the front-end know where we are. */
- try_block = begin_function_try_block ();
+ try_block = begin_function_try_block (&compound_stmt);
/* Parse the function-body. */
ctor_initializer_p
= cp_parser_ctor_initializer_opt_and_function_body (parser);
@@ -14241,7 +14242,7 @@ cp_parser_function_try_block (cp_parser* parser)
/* Parse the handlers. */
cp_parser_handler_seq (parser);
/* We're done with the handlers. */
- finish_function_handler_sequence (try_block);
+ finish_function_handler_sequence (try_block, compound_stmt);
return ctor_initializer_p;
}