Commit 3c5c0849 by Mark Mitchell Committed by Mark Mitchell

cp-tree.h (start_handler_parms): New function.

	* cp-tree.h (start_handler_parms): New function.
	(expand_start_catch_block): Take only one parameter.
	(start_handler_parms): New function.
	* decl.c (start_handler_parms): Define it.
	* except.c (process_start_catch_block): Take only one parameter.
	Don't call grokdeclarator here.
	(expand_start_catch_block): Don't call grokdeclarator here,
	either.
	* parse.y (handler_args): Adjust call to
	expand_start_catch_block.  Use start_handler_parms.
	* pt.c (push_template_decl_real): Make permanent lists have
	permanent elements.
	(tsubst_expr): Adjust calls to expand_start_catch_block
	appropriately.
	* semantics.c (expand_stmt): Likewise.

From-SVN: r28983
parent 7d53d823
1999-08-30 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (start_handler_parms): New function.
(expand_start_catch_block): Take only one parameter.
(start_handler_parms): New function.
* decl.c (start_handler_parms): Define it.
* except.c (process_start_catch_block): Take only one parameter.
Don't call grokdeclarator here.
(expand_start_catch_block): Don't call grokdeclarator here,
either.
* parse.y (handler_args): Adjust call to
expand_start_catch_block. Use start_handler_parms.
* pt.c (push_template_decl_real): Make permanent lists have
permanent elements.
(tsubst_expr): Adjust calls to expand_start_catch_block
appropriately.
* semantics.c (expand_stmt): Likewise.
1999-08-29 Alex Samuel <samuel@codesourcery.com> 1999-08-29 Alex Samuel <samuel@codesourcery.com>
* pt.c (push_template_decl_real): Use template declaration from * pt.c (push_template_decl_real): Use template declaration from
......
...@@ -2932,6 +2932,7 @@ extern void finish_decl PROTO((tree, tree, tree)); ...@@ -2932,6 +2932,7 @@ extern void finish_decl PROTO((tree, tree, tree));
extern void maybe_inject_for_scope_var PROTO((tree)); extern void maybe_inject_for_scope_var PROTO((tree));
extern void initialize_local_var PROTO((tree, tree, int)); extern void initialize_local_var PROTO((tree, tree, int));
extern void expand_static_init PROTO((tree, tree)); extern void expand_static_init PROTO((tree, tree));
extern void start_handler_parms PROTO((tree, tree));
extern int complete_array_type PROTO((tree, tree, int)); extern int complete_array_type PROTO((tree, tree, int));
extern tree build_ptrmemfunc_type PROTO((tree)); extern tree build_ptrmemfunc_type PROTO((tree));
/* the grokdeclarator prototype is in decl.h */ /* the grokdeclarator prototype is in decl.h */
...@@ -3080,7 +3081,7 @@ extern int cp_line_of PROTO((tree)); ...@@ -3080,7 +3081,7 @@ extern int cp_line_of PROTO((tree));
/* in except.c */ /* in except.c */
extern void init_exception_processing PROTO((void)); extern void init_exception_processing PROTO((void));
extern void expand_start_catch_block PROTO((tree, tree)); extern void expand_start_catch_block PROTO((tree));
extern void expand_end_catch_block PROTO((void)); extern void expand_end_catch_block PROTO((void));
extern void expand_builtin_throw PROTO((void)); extern void expand_builtin_throw PROTO((void));
extern void expand_start_eh_spec PROTO((void)); extern void expand_start_eh_spec PROTO((void));
...@@ -3349,6 +3350,7 @@ extern tree begin_function_try_block PROTO((void)); ...@@ -3349,6 +3350,7 @@ extern tree begin_function_try_block PROTO((void));
extern void finish_function_try_block PROTO((tree)); extern void finish_function_try_block PROTO((tree));
extern void finish_function_handler_sequence PROTO((tree)); extern void finish_function_handler_sequence PROTO((tree));
extern tree begin_handler PROTO((void)); extern tree begin_handler PROTO((void));
extern void start_handler_parms PROTO((tree, tree));
extern void finish_handler_parms PROTO((tree)); extern void finish_handler_parms PROTO((tree));
extern void finish_handler PROTO((tree)); extern void finish_handler PROTO((tree));
extern void finish_cleanup PROTO((tree, tree)); extern void finish_cleanup PROTO((tree, tree));
......
...@@ -8318,6 +8318,27 @@ expand_static_init (decl, init) ...@@ -8318,6 +8318,27 @@ expand_static_init (decl, init)
} }
} }
/* Finish the declaration of a catch-parameter. */
void
start_handler_parms (declspecs, declarator)
tree declspecs;
tree declarator;
{
tree decl;
if (declspecs)
{
decl = grokdeclarator (declarator, declspecs, CATCHPARM,
1, NULL_TREE);
if (decl == NULL_TREE)
error ("invalid catch parameter");
}
else
decl = NULL_TREE;
expand_start_catch_block (decl);
}
/* Make TYPE a complete type based on INITIAL_VALUE. /* Make TYPE a complete type based on INITIAL_VALUE.
Return 0 if successful, 1 if INITIAL_VALUE can't be deciphered, Return 0 if successful, 1 if INITIAL_VALUE can't be deciphered,
2 if there was no information (in which case assume 0 if DO_DEFAULT). */ 2 if there was no information (in which case assume 0 if DO_DEFAULT). */
......
...@@ -51,7 +51,7 @@ static tree get_eh_caught PROTO((void)); ...@@ -51,7 +51,7 @@ static tree get_eh_caught PROTO((void));
static tree get_eh_handlers PROTO((void)); static tree get_eh_handlers PROTO((void));
#endif #endif
static tree do_pop_exception PROTO((void)); static tree do_pop_exception PROTO((void));
static void process_start_catch_block PROTO((tree, tree)); static void process_start_catch_block PROTO((tree));
static tree build_eh_type_type_ref PROTO((tree)); static tree build_eh_type_type_ref PROTO((tree));
static tree build_terminate_handler PROTO((void)); static tree build_terminate_handler PROTO((void));
static tree alloc_eh_object PROTO((tree)); static tree alloc_eh_object PROTO((tree));
...@@ -513,17 +513,17 @@ build_terminate_handler () ...@@ -513,17 +513,17 @@ build_terminate_handler ()
(ie: it ends up as the "else" clause rather than an "else if" clause) */ (ie: it ends up as the "else" clause rather than an "else if" clause) */
void void
expand_start_catch_block (declspecs, declarator) expand_start_catch_block (decl)
tree declspecs, declarator;
{
tree decl; tree decl;
{
if (building_stmt_tree ()) if (building_stmt_tree ())
{ {
if (declspecs) if (decl)
{ {
decl = grokdeclarator (declarator, declspecs, CATCHPARM, /* We must ensure that DECL_CONTEXT is set up before we call
1, NULL_TREE); push_template_decl; that code depends on DECL_CONTEXT
being set correctly. */
DECL_CONTEXT (decl) = current_function_decl;
if (processing_template_decl) if (processing_template_decl)
decl = push_template_decl (decl); decl = push_template_decl (decl);
pushdecl (decl); pushdecl (decl);
...@@ -535,7 +535,7 @@ expand_start_catch_block (declspecs, declarator) ...@@ -535,7 +535,7 @@ expand_start_catch_block (declspecs, declarator)
if (! doing_eh (1)) if (! doing_eh (1))
return; return;
process_start_catch_block (declspecs, declarator); process_start_catch_block (decl);
} }
/* This function performs the expand_start_catch_block functionality for /* This function performs the expand_start_catch_block functionality for
...@@ -544,10 +544,9 @@ expand_start_catch_block (declspecs, declarator) ...@@ -544,10 +544,9 @@ expand_start_catch_block (declspecs, declarator)
nothing additional. */ nothing additional. */
static void static void
process_start_catch_block (declspecs, declarator) process_start_catch_block (decl)
tree declspecs, declarator; tree decl;
{ {
tree decl = NULL_TREE;
tree init; tree init;
/* Create a binding level for the eh_info and the exception object /* Create a binding level for the eh_info and the exception object
...@@ -555,16 +554,8 @@ process_start_catch_block (declspecs, declarator) ...@@ -555,16 +554,8 @@ process_start_catch_block (declspecs, declarator)
pushlevel (0); pushlevel (0);
expand_start_bindings (0); expand_start_bindings (0);
if (decl && !complete_ptr_ref_or_void_ptr_p (TREE_TYPE (decl), NULL_TREE))
if (declspecs)
{
decl = grokdeclarator (declarator, declspecs, CATCHPARM, 1, NULL_TREE);
if (decl == NULL_TREE)
error ("invalid catch parameter");
else if (!complete_ptr_ref_or_void_ptr_p (TREE_TYPE (decl), NULL_TREE))
decl = NULL_TREE; decl = NULL_TREE;
}
if (decl) if (decl)
start_catch_handler (build_eh_type_type_ref (TREE_TYPE (decl))); start_catch_handler (build_eh_type_type_ref (TREE_TYPE (decl)));
...@@ -701,7 +692,7 @@ expand_end_eh_spec (raises) ...@@ -701,7 +692,7 @@ expand_end_eh_spec (raises)
int count = 0; int count = 0;
expand_start_all_catch (); expand_start_all_catch ();
expand_start_catch_block (NULL_TREE, NULL_TREE); expand_start_catch_block (NULL_TREE);
/* Build up an array of type_infos. */ /* Build up an array of type_infos. */
for (; raises && TREE_VALUE (raises); raises = TREE_CHAIN (raises)) for (; raises && TREE_VALUE (raises); raises = TREE_CHAIN (raises))
......
...@@ -720,17 +720,17 @@ static const short yyrline[] = { 0, ...@@ -720,17 +720,17 @@ static const short yyrline[] = { 0,
3267, 3268, 3271, 3271, 3274, 3274, 3277, 3277, 3279, 3281, 3267, 3268, 3271, 3271, 3274, 3274, 3277, 3277, 3279, 3281,
3283, 3285, 3291, 3297, 3300, 3303, 3309, 3311, 3313, 3317, 3283, 3285, 3291, 3297, 3300, 3303, 3309, 3311, 3313, 3317,
3319, 3320, 3321, 3323, 3326, 3329, 3332, 3338, 3342, 3344, 3319, 3320, 3321, 3323, 3326, 3329, 3332, 3338, 3342, 3344,
3347, 3349, 3352, 3356, 3358, 3361, 3363, 3366, 3383, 3389, 3347, 3349, 3352, 3356, 3358, 3361, 3363, 3366, 3383, 3391,
3392, 3394, 3396, 3400, 3403, 3404, 3412, 3416, 3420, 3423, 3394, 3396, 3398, 3402, 3405, 3406, 3414, 3418, 3422, 3425,
3424, 3430, 3433, 3436, 3438, 3442, 3447, 3450, 3460, 3465, 3426, 3432, 3435, 3438, 3440, 3444, 3449, 3452, 3462, 3467,
3466, 3473, 3476, 3479, 3481, 3484, 3486, 3496, 3510, 3514, 3468, 3475, 3478, 3481, 3483, 3486, 3488, 3498, 3512, 3516,
3517, 3519, 3523, 3527, 3530, 3533, 3535, 3539, 3541, 3548, 3519, 3521, 3525, 3529, 3532, 3535, 3537, 3541, 3543, 3550,
3555, 3558, 3562, 3566, 3570, 3576, 3580, 3585, 3587, 3590, 3557, 3560, 3564, 3568, 3572, 3578, 3582, 3587, 3589, 3592,
3595, 3601, 3612, 3615, 3617, 3621, 3629, 3632, 3636, 3639, 3597, 3603, 3614, 3617, 3619, 3623, 3631, 3634, 3638, 3641,
3641, 3643, 3649, 3654, 3657, 3659, 3661, 3663, 3665, 3667, 3643, 3645, 3651, 3656, 3659, 3661, 3663, 3665, 3667, 3669,
3669, 3671, 3673, 3675, 3677, 3679, 3681, 3683, 3685, 3687, 3671, 3673, 3675, 3677, 3679, 3681, 3683, 3685, 3687, 3689,
3689, 3691, 3693, 3695, 3697, 3699, 3701, 3703, 3705, 3707, 3691, 3693, 3695, 3697, 3699, 3701, 3703, 3705, 3707, 3709,
3709, 3711, 3713, 3715, 3717, 3719, 3722, 3724 3711, 3713, 3715, 3717, 3719, 3721, 3724, 3726
}; };
#endif #endif
...@@ -7742,111 +7742,113 @@ case 775: ...@@ -7742,111 +7742,113 @@ case 775:
break;} break;}
case 778: case 778:
#line 3368 "parse.y" #line 3368 "parse.y"
{ expand_start_catch_block (NULL_TREE, NULL_TREE); ; { expand_start_catch_block (NULL_TREE); ;
break;} break;}
case 779: case 779:
#line 3384 "parse.y" #line 3384 "parse.y"
{ check_for_new_type ("inside exception declarations", yyvsp[-1].ftype); {
expand_start_catch_block (TREE_PURPOSE (yyvsp[-1].ftype.t), check_for_new_type ("inside exception declarations", yyvsp[-1].ftype);
TREE_VALUE (yyvsp[-1].ftype.t)); ; start_handler_parms (TREE_PURPOSE (yyvsp[-1].ftype.t),
TREE_VALUE (yyvsp[-1].ftype.t));
;
break;} break;}
case 780: case 780:
#line 3391 "parse.y" #line 3393 "parse.y"
{ finish_label_stmt (yyvsp[-1].ttype); ; { finish_label_stmt (yyvsp[-1].ttype); ;
break;} break;}
case 781: case 781:
#line 3393 "parse.y" #line 3395 "parse.y"
{ finish_label_stmt (yyvsp[-1].ttype); ; { finish_label_stmt (yyvsp[-1].ttype); ;
break;} break;}
case 782: case 782:
#line 3395 "parse.y" #line 3397 "parse.y"
{ finish_label_stmt (yyvsp[-1].ttype); ; { finish_label_stmt (yyvsp[-1].ttype); ;
break;} break;}
case 783: case 783:
#line 3397 "parse.y" #line 3399 "parse.y"
{ finish_label_stmt (yyvsp[-1].ttype); ; { finish_label_stmt (yyvsp[-1].ttype); ;
break;} break;}
case 784: case 784:
#line 3402 "parse.y" #line 3404 "parse.y"
{ finish_expr_stmt (yyvsp[-1].ttype); ; { finish_expr_stmt (yyvsp[-1].ttype); ;
break;} break;}
case 786: case 786:
#line 3405 "parse.y" #line 3407 "parse.y"
{ if (pedantic) { if (pedantic)
pedwarn ("ANSI C++ forbids compound statements inside for initializations"); pedwarn ("ANSI C++ forbids compound statements inside for initializations");
; ;
break;} break;}
case 787: case 787:
#line 3414 "parse.y" #line 3416 "parse.y"
{ emit_line_note (input_filename, lineno); { emit_line_note (input_filename, lineno);
yyval.ttype = NULL_TREE; ; yyval.ttype = NULL_TREE; ;
break;} break;}
case 788: case 788:
#line 3417 "parse.y" #line 3419 "parse.y"
{ emit_line_note (input_filename, lineno); ; { emit_line_note (input_filename, lineno); ;
break;} break;}
case 789: case 789:
#line 3422 "parse.y" #line 3424 "parse.y"
{ yyval.ttype = NULL_TREE; ; { yyval.ttype = NULL_TREE; ;
break;} break;}
case 791: case 791:
#line 3425 "parse.y" #line 3427 "parse.y"
{ yyval.ttype = NULL_TREE; ; { yyval.ttype = NULL_TREE; ;
break;} break;}
case 792: case 792:
#line 3432 "parse.y" #line 3434 "parse.y"
{ yyval.ttype = NULL_TREE; ; { yyval.ttype = NULL_TREE; ;
break;} break;}
case 795: case 795:
#line 3439 "parse.y" #line 3441 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, yyvsp[0].ttype); ; { yyval.ttype = chainon (yyval.ttype, yyvsp[0].ttype); ;
break;} break;}
case 796: case 796:
#line 3444 "parse.y" #line 3446 "parse.y"
{ yyval.ttype = build_tree_list (yyval.ttype, yyvsp[-1].ttype); ; { yyval.ttype = build_tree_list (yyval.ttype, yyvsp[-1].ttype); ;
break;} break;}
case 797: case 797:
#line 3449 "parse.y" #line 3451 "parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyval.ttype, NULL_TREE); ; { yyval.ttype = tree_cons (NULL_TREE, yyval.ttype, NULL_TREE); ;
break;} break;}
case 798: case 798:
#line 3451 "parse.y" #line 3453 "parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype); ; { yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype); ;
break;} break;}
case 799: case 799:
#line 3462 "parse.y" #line 3464 "parse.y"
{ {
yyval.ttype = empty_parms(); yyval.ttype = empty_parms();
; ;
break;} break;}
case 801: case 801:
#line 3467 "parse.y" #line 3469 "parse.y"
{ yyval.ttype = finish_parmlist (build_tree_list (NULL_TREE, yyvsp[0].ftype.t), 0); { yyval.ttype = finish_parmlist (build_tree_list (NULL_TREE, yyvsp[0].ftype.t), 0);
check_for_new_type ("inside parameter list", yyvsp[0].ftype); ; check_for_new_type ("inside parameter list", yyvsp[0].ftype); ;
break;} break;}
case 802: case 802:
#line 3475 "parse.y" #line 3477 "parse.y"
{ yyval.ttype = finish_parmlist (yyval.ttype, 0); ; { yyval.ttype = finish_parmlist (yyval.ttype, 0); ;
break;} break;}
case 803: case 803:
#line 3477 "parse.y" #line 3479 "parse.y"
{ yyval.ttype = finish_parmlist (yyvsp[-1].ttype, 1); ; { yyval.ttype = finish_parmlist (yyvsp[-1].ttype, 1); ;
break;} break;}
case 804: case 804:
#line 3480 "parse.y" #line 3482 "parse.y"
{ yyval.ttype = finish_parmlist (yyvsp[-1].ttype, 1); ; { yyval.ttype = finish_parmlist (yyvsp[-1].ttype, 1); ;
break;} break;}
case 805: case 805:
#line 3482 "parse.y" #line 3484 "parse.y"
{ yyval.ttype = finish_parmlist (build_tree_list (NULL_TREE, { yyval.ttype = finish_parmlist (build_tree_list (NULL_TREE,
yyvsp[-1].ftype.t), 1); ; yyvsp[-1].ftype.t), 1); ;
break;} break;}
case 806: case 806:
#line 3485 "parse.y" #line 3487 "parse.y"
{ yyval.ttype = finish_parmlist (NULL_TREE, 1); ; { yyval.ttype = finish_parmlist (NULL_TREE, 1); ;
break;} break;}
case 807: case 807:
#line 3487 "parse.y" #line 3489 "parse.y"
{ {
/* This helps us recover from really nasty /* This helps us recover from really nasty
parse errors, for example, a missing right parse errors, for example, a missing right
...@@ -7858,7 +7860,7 @@ case 807: ...@@ -7858,7 +7860,7 @@ case 807:
; ;
break;} break;}
case 808: case 808:
#line 3497 "parse.y" #line 3499 "parse.y"
{ {
/* This helps us recover from really nasty /* This helps us recover from really nasty
parse errors, for example, a missing right parse errors, for example, a missing right
...@@ -7871,99 +7873,99 @@ case 808: ...@@ -7871,99 +7873,99 @@ case 808:
; ;
break;} break;}
case 809: case 809:
#line 3512 "parse.y" #line 3514 "parse.y"
{ maybe_snarf_defarg (); ; { maybe_snarf_defarg (); ;
break;} break;}
case 810: case 810:
#line 3514 "parse.y" #line 3516 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ; { yyval.ttype = yyvsp[0].ttype; ;
break;} break;}
case 813: case 813:
#line 3525 "parse.y" #line 3527 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[0].ftype); { check_for_new_type ("in a parameter list", yyvsp[0].ftype);
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ftype.t); ; yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ftype.t); ;
break;} break;}
case 814: case 814:
#line 3528 "parse.y" #line 3530 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[-1].ftype); { check_for_new_type ("in a parameter list", yyvsp[-1].ftype);
yyval.ttype = build_tree_list (yyvsp[0].ttype, yyvsp[-1].ftype.t); ; yyval.ttype = build_tree_list (yyvsp[0].ttype, yyvsp[-1].ftype.t); ;
break;} break;}
case 815: case 815:
#line 3531 "parse.y" #line 3533 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[0].ftype); { check_for_new_type ("in a parameter list", yyvsp[0].ftype);
yyval.ttype = chainon (yyval.ttype, yyvsp[0].ftype.t); ; yyval.ttype = chainon (yyval.ttype, yyvsp[0].ftype.t); ;
break;} break;}
case 816: case 816:
#line 3534 "parse.y" #line 3536 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ; { yyval.ttype = chainon (yyval.ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;} break;}
case 817: case 817:
#line 3536 "parse.y" #line 3538 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, build_tree_list (yyvsp[0].ttype, yyvsp[-2].ttype)); ; { yyval.ttype = chainon (yyval.ttype, build_tree_list (yyvsp[0].ttype, yyvsp[-2].ttype)); ;
break;} break;}
case 819: case 819:
#line 3542 "parse.y" #line 3544 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[-1].ftype); { check_for_new_type ("in a parameter list", yyvsp[-1].ftype);
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[-1].ftype.t); ; yyval.ttype = build_tree_list (NULL_TREE, yyvsp[-1].ftype.t); ;
break;} break;}
case 820: case 820:
#line 3552 "parse.y" #line 3554 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t); { tree specs = strip_attrs (yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag;
yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype); ; yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype); ;
break;} break;}
case 821: case 821:
#line 3556 "parse.y" #line 3558 "parse.y"
{ yyval.ftype.t = build_tree_list (yyvsp[-1].ftype.t, yyvsp[0].ttype); { yyval.ftype.t = build_tree_list (yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ; yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;} break;}
case 822: case 822:
#line 3559 "parse.y" #line 3561 "parse.y"
{ yyval.ftype.t = build_tree_list (build_decl_list (NULL_TREE, yyvsp[-1].ftype.t), { yyval.ftype.t = build_tree_list (build_decl_list (NULL_TREE, yyvsp[-1].ftype.t),
yyvsp[0].ttype); yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ; yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;} break;}
case 823: case 823:
#line 3563 "parse.y" #line 3565 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t); { tree specs = strip_attrs (yyvsp[-1].ftype.t);
yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype); yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ; yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;} break;}
case 824: case 824:
#line 3567 "parse.y" #line 3569 "parse.y"
{ tree specs = strip_attrs (yyvsp[0].ftype.t); { tree specs = strip_attrs (yyvsp[0].ftype.t);
yyval.ftype.t = build_tree_list (specs, NULL_TREE); yyval.ftype.t = build_tree_list (specs, NULL_TREE);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ; yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;} break;}
case 825: case 825:
#line 3571 "parse.y" #line 3573 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ttype); { tree specs = strip_attrs (yyvsp[-1].ttype);
yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype); yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype);
yyval.ftype.new_type_flag = 0; ; yyval.ftype.new_type_flag = 0; ;
break;} break;}
case 826: case 826:
#line 3578 "parse.y" #line 3580 "parse.y"
{ yyval.ftype.t = build_tree_list (NULL_TREE, yyvsp[0].ftype.t); { yyval.ftype.t = build_tree_list (NULL_TREE, yyvsp[0].ftype.t);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ; yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;} break;}
case 827: case 827:
#line 3581 "parse.y" #line 3583 "parse.y"
{ yyval.ftype.t = build_tree_list (yyvsp[0].ttype, yyvsp[-1].ftype.t); { yyval.ftype.t = build_tree_list (yyvsp[0].ttype, yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ; yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;} break;}
case 830: case 830:
#line 3592 "parse.y" #line 3594 "parse.y"
{ see_typename (); ; { see_typename (); ;
break;} break;}
case 831: case 831:
#line 3597 "parse.y" #line 3599 "parse.y"
{ {
error ("type specifier omitted for parameter"); error ("type specifier omitted for parameter");
yyval.ttype = build_tree_list (integer_type_node, NULL_TREE); yyval.ttype = build_tree_list (integer_type_node, NULL_TREE);
; ;
break;} break;}
case 832: case 832:
#line 3602 "parse.y" #line 3604 "parse.y"
{ {
error ("type specifier omitted for parameter"); error ("type specifier omitted for parameter");
if (TREE_CODE (yyval.ttype) == SCOPE_REF if (TREE_CODE (yyval.ttype) == SCOPE_REF
...@@ -7974,192 +7976,192 @@ case 832: ...@@ -7974,192 +7976,192 @@ case 832:
; ;
break;} break;}
case 833: case 833:
#line 3614 "parse.y" #line 3616 "parse.y"
{ yyval.ttype = NULL_TREE; ; { yyval.ttype = NULL_TREE; ;
break;} break;}
case 834: case 834:
#line 3616 "parse.y" #line 3618 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ; { yyval.ttype = yyvsp[-1].ttype; ;
break;} break;}
case 835: case 835:
#line 3618 "parse.y" #line 3620 "parse.y"
{ yyval.ttype = empty_except_spec; ; { yyval.ttype = empty_except_spec; ;
break;} break;}
case 836: case 836:
#line 3623 "parse.y" #line 3625 "parse.y"
{ {
check_for_new_type ("exception specifier", yyvsp[0].ftype); check_for_new_type ("exception specifier", yyvsp[0].ftype);
yyval.ttype = groktypename (yyvsp[0].ftype.t); yyval.ttype = groktypename (yyvsp[0].ftype.t);
; ;
break;} break;}
case 837: case 837:
#line 3631 "parse.y" #line 3633 "parse.y"
{ yyval.ttype = add_exception_specifier (NULL_TREE, yyvsp[0].ttype, 1); ; { yyval.ttype = add_exception_specifier (NULL_TREE, yyvsp[0].ttype, 1); ;
break;} break;}
case 838: case 838:
#line 3633 "parse.y" #line 3635 "parse.y"
{ yyval.ttype = add_exception_specifier (yyvsp[-2].ttype, yyvsp[0].ttype, 1); ; { yyval.ttype = add_exception_specifier (yyvsp[-2].ttype, yyvsp[0].ttype, 1); ;
break;} break;}
case 839: case 839:
#line 3638 "parse.y" #line 3640 "parse.y"
{ yyval.ttype = NULL_TREE; ; { yyval.ttype = NULL_TREE; ;
break;} break;}
case 840: case 840:
#line 3640 "parse.y" #line 3642 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ; { yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;} break;}
case 841: case 841:
#line 3642 "parse.y" #line 3644 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ; { yyval.ttype = make_reference_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;} break;}
case 842: case 842:
#line 3644 "parse.y" #line 3646 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); { tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg); yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
; ;
break;} break;}
case 843: case 843:
#line 3651 "parse.y" #line 3653 "parse.y"
{ got_scope = NULL_TREE; ; { got_scope = NULL_TREE; ;
break;} break;}
case 844: case 844:
#line 3656 "parse.y" #line 3658 "parse.y"
{ yyval.ttype = ansi_opname[MULT_EXPR]; ; { yyval.ttype = ansi_opname[MULT_EXPR]; ;
break;} break;}
case 845: case 845:
#line 3658 "parse.y" #line 3660 "parse.y"
{ yyval.ttype = ansi_opname[TRUNC_DIV_EXPR]; ; { yyval.ttype = ansi_opname[TRUNC_DIV_EXPR]; ;
break;} break;}
case 846: case 846:
#line 3660 "parse.y" #line 3662 "parse.y"
{ yyval.ttype = ansi_opname[TRUNC_MOD_EXPR]; ; { yyval.ttype = ansi_opname[TRUNC_MOD_EXPR]; ;
break;} break;}
case 847: case 847:
#line 3662 "parse.y" #line 3664 "parse.y"
{ yyval.ttype = ansi_opname[PLUS_EXPR]; ; { yyval.ttype = ansi_opname[PLUS_EXPR]; ;
break;} break;}
case 848: case 848:
#line 3664 "parse.y" #line 3666 "parse.y"
{ yyval.ttype = ansi_opname[MINUS_EXPR]; ; { yyval.ttype = ansi_opname[MINUS_EXPR]; ;
break;} break;}
case 849: case 849:
#line 3666 "parse.y" #line 3668 "parse.y"
{ yyval.ttype = ansi_opname[BIT_AND_EXPR]; ; { yyval.ttype = ansi_opname[BIT_AND_EXPR]; ;
break;} break;}
case 850: case 850:
#line 3668 "parse.y" #line 3670 "parse.y"
{ yyval.ttype = ansi_opname[BIT_IOR_EXPR]; ; { yyval.ttype = ansi_opname[BIT_IOR_EXPR]; ;
break;} break;}
case 851: case 851:
#line 3670 "parse.y" #line 3672 "parse.y"
{ yyval.ttype = ansi_opname[BIT_XOR_EXPR]; ; { yyval.ttype = ansi_opname[BIT_XOR_EXPR]; ;
break;} break;}
case 852: case 852:
#line 3672 "parse.y" #line 3674 "parse.y"
{ yyval.ttype = ansi_opname[BIT_NOT_EXPR]; ; { yyval.ttype = ansi_opname[BIT_NOT_EXPR]; ;
break;} break;}
case 853: case 853:
#line 3674 "parse.y" #line 3676 "parse.y"
{ yyval.ttype = ansi_opname[COMPOUND_EXPR]; ; { yyval.ttype = ansi_opname[COMPOUND_EXPR]; ;
break;} break;}
case 854: case 854:
#line 3676 "parse.y" #line 3678 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ; { yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;} break;}
case 855: case 855:
#line 3678 "parse.y" #line 3680 "parse.y"
{ yyval.ttype = ansi_opname[LT_EXPR]; ; { yyval.ttype = ansi_opname[LT_EXPR]; ;
break;} break;}
case 856: case 856:
#line 3680 "parse.y" #line 3682 "parse.y"
{ yyval.ttype = ansi_opname[GT_EXPR]; ; { yyval.ttype = ansi_opname[GT_EXPR]; ;
break;} break;}
case 857: case 857:
#line 3682 "parse.y" #line 3684 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ; { yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;} break;}
case 858: case 858:
#line 3684 "parse.y" #line 3686 "parse.y"
{ yyval.ttype = ansi_assopname[yyvsp[0].code]; ; { yyval.ttype = ansi_assopname[yyvsp[0].code]; ;
break;} break;}
case 859: case 859:
#line 3686 "parse.y" #line 3688 "parse.y"
{ yyval.ttype = ansi_opname [MODIFY_EXPR]; ; { yyval.ttype = ansi_opname [MODIFY_EXPR]; ;
break;} break;}
case 860: case 860:
#line 3688 "parse.y" #line 3690 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ; { yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;} break;}
case 861: case 861:
#line 3690 "parse.y" #line 3692 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ; { yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;} break;}
case 862: case 862:
#line 3692 "parse.y" #line 3694 "parse.y"
{ yyval.ttype = ansi_opname[POSTINCREMENT_EXPR]; ; { yyval.ttype = ansi_opname[POSTINCREMENT_EXPR]; ;
break;} break;}
case 863: case 863:
#line 3694 "parse.y" #line 3696 "parse.y"
{ yyval.ttype = ansi_opname[PREDECREMENT_EXPR]; ; { yyval.ttype = ansi_opname[PREDECREMENT_EXPR]; ;
break;} break;}
case 864: case 864:
#line 3696 "parse.y" #line 3698 "parse.y"
{ yyval.ttype = ansi_opname[TRUTH_ANDIF_EXPR]; ; { yyval.ttype = ansi_opname[TRUTH_ANDIF_EXPR]; ;
break;} break;}
case 865: case 865:
#line 3698 "parse.y" #line 3700 "parse.y"
{ yyval.ttype = ansi_opname[TRUTH_ORIF_EXPR]; ; { yyval.ttype = ansi_opname[TRUTH_ORIF_EXPR]; ;
break;} break;}
case 866: case 866:
#line 3700 "parse.y" #line 3702 "parse.y"
{ yyval.ttype = ansi_opname[TRUTH_NOT_EXPR]; ; { yyval.ttype = ansi_opname[TRUTH_NOT_EXPR]; ;
break;} break;}
case 867: case 867:
#line 3702 "parse.y" #line 3704 "parse.y"
{ yyval.ttype = ansi_opname[COND_EXPR]; ; { yyval.ttype = ansi_opname[COND_EXPR]; ;
break;} break;}
case 868: case 868:
#line 3704 "parse.y" #line 3706 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ; { yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;} break;}
case 869: case 869:
#line 3706 "parse.y" #line 3708 "parse.y"
{ yyval.ttype = ansi_opname[COMPONENT_REF]; ; { yyval.ttype = ansi_opname[COMPONENT_REF]; ;
break;} break;}
case 870: case 870:
#line 3708 "parse.y" #line 3710 "parse.y"
{ yyval.ttype = ansi_opname[MEMBER_REF]; ; { yyval.ttype = ansi_opname[MEMBER_REF]; ;
break;} break;}
case 871: case 871:
#line 3710 "parse.y" #line 3712 "parse.y"
{ yyval.ttype = ansi_opname[CALL_EXPR]; ; { yyval.ttype = ansi_opname[CALL_EXPR]; ;
break;} break;}
case 872: case 872:
#line 3712 "parse.y" #line 3714 "parse.y"
{ yyval.ttype = ansi_opname[ARRAY_REF]; ; { yyval.ttype = ansi_opname[ARRAY_REF]; ;
break;} break;}
case 873: case 873:
#line 3714 "parse.y" #line 3716 "parse.y"
{ yyval.ttype = ansi_opname[NEW_EXPR]; ; { yyval.ttype = ansi_opname[NEW_EXPR]; ;
break;} break;}
case 874: case 874:
#line 3716 "parse.y" #line 3718 "parse.y"
{ yyval.ttype = ansi_opname[DELETE_EXPR]; ; { yyval.ttype = ansi_opname[DELETE_EXPR]; ;
break;} break;}
case 875: case 875:
#line 3718 "parse.y" #line 3720 "parse.y"
{ yyval.ttype = ansi_opname[VEC_NEW_EXPR]; ; { yyval.ttype = ansi_opname[VEC_NEW_EXPR]; ;
break;} break;}
case 876: case 876:
#line 3720 "parse.y" #line 3722 "parse.y"
{ yyval.ttype = ansi_opname[VEC_DELETE_EXPR]; ; { yyval.ttype = ansi_opname[VEC_DELETE_EXPR]; ;
break;} break;}
case 877: case 877:
#line 3723 "parse.y" #line 3725 "parse.y"
{ yyval.ttype = grokoptypename (yyvsp[-1].ftype.t, yyvsp[0].ttype); ; { yyval.ttype = grokoptypename (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;} break;}
case 878: case 878:
#line 3725 "parse.y" #line 3727 "parse.y"
{ yyval.ttype = ansi_opname[ERROR_MARK]; ; { yyval.ttype = ansi_opname[ERROR_MARK]; ;
break;} break;}
} }
...@@ -8384,7 +8386,7 @@ yyerrhandle: ...@@ -8384,7 +8386,7 @@ yyerrhandle:
} }
return 1; return 1;
} }
#line 3728 "parse.y" #line 3730 "parse.y"
#ifdef SPEW_DEBUG #ifdef SPEW_DEBUG
......
...@@ -3365,7 +3365,7 @@ type_specifier_seq: ...@@ -3365,7 +3365,7 @@ type_specifier_seq:
handler_args: handler_args:
'(' ELLIPSIS ')' '(' ELLIPSIS ')'
{ expand_start_catch_block (NULL_TREE, NULL_TREE); } { expand_start_catch_block (NULL_TREE); }
/* This doesn't allow reference parameters, the below does. /* This doesn't allow reference parameters, the below does.
| '(' type_specifier_seq absdcl ')' | '(' type_specifier_seq absdcl ')'
{ check_for_new_type ("inside exception declarations", $2); { check_for_new_type ("inside exception declarations", $2);
...@@ -3381,9 +3381,11 @@ handler_args: ...@@ -3381,9 +3381,11 @@ handler_args:
expand_start_catch_block ($2.t, $3); } expand_start_catch_block ($2.t, $3); }
This allows reference parameters... */ This allows reference parameters... */
| '(' parm ')' | '(' parm ')'
{ check_for_new_type ("inside exception declarations", $2); {
expand_start_catch_block (TREE_PURPOSE ($2.t), check_for_new_type ("inside exception declarations", $2);
TREE_VALUE ($2.t)); } start_handler_parms (TREE_PURPOSE ($2.t),
TREE_VALUE ($2.t));
}
; ;
label_colon: label_colon:
......
...@@ -2599,7 +2599,7 @@ push_template_decl_real (decl, is_friend) ...@@ -2599,7 +2599,7 @@ push_template_decl_real (decl, is_friend)
if (primary) if (primary)
DECL_PRIMARY_TEMPLATE (tmpl) = tmpl; DECL_PRIMARY_TEMPLATE (tmpl) = tmpl;
info = perm_tree_cons (tmpl, args, NULL_TREE); info = perm_tree_cons (tmpl, copy_to_permanent (args), NULL_TREE);
if (DECL_IMPLICIT_TYPEDEF_P (decl)) if (DECL_IMPLICIT_TYPEDEF_P (decl))
{ {
...@@ -7465,14 +7465,11 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7465,14 +7465,11 @@ tsubst_expr (t, args, complain, in_decl)
lineno = STMT_LINENO (t); lineno = STMT_LINENO (t);
stmt = begin_handler (); stmt = begin_handler ();
if (HANDLER_PARMS (t)) if (HANDLER_PARMS (t))
{
tree d = HANDLER_PARMS (t);
expand_start_catch_block expand_start_catch_block
(tsubst (TREE_OPERAND (d, 1), args, complain, in_decl), (tsubst (DECL_STMT_DECL (HANDLER_PARMS (t)),
tsubst (TREE_OPERAND (d, 0), args, complain, in_decl)); args, complain, in_decl));
}
else else
expand_start_catch_block (NULL_TREE, NULL_TREE); expand_start_catch_block (NULL_TREE);
finish_handler_parms (stmt); finish_handler_parms (stmt);
tsubst_expr (HANDLER_BODY (t), args, complain, in_decl); tsubst_expr (HANDLER_BODY (t), args, complain, in_decl);
finish_handler (stmt); finish_handler (stmt);
......
...@@ -2182,13 +2182,9 @@ expand_stmt (t) ...@@ -2182,13 +2182,9 @@ expand_stmt (t)
lineno = STMT_LINENO (t); lineno = STMT_LINENO (t);
begin_handler (); begin_handler ();
if (HANDLER_PARMS (t)) if (HANDLER_PARMS (t))
{ expand_start_catch_block (DECL_STMT_DECL (HANDLER_PARMS (t)));
tree d = HANDLER_PARMS (t);
expand_start_catch_block (TREE_OPERAND (d, 1),
TREE_OPERAND (d, 0));
}
else else
expand_start_catch_block (NULL_TREE, NULL_TREE); expand_start_catch_block (NULL_TREE);
finish_handler_parms (NULL_TREE); finish_handler_parms (NULL_TREE);
expand_stmt (HANDLER_BODY (t)); expand_stmt (HANDLER_BODY (t));
finish_handler (NULL_TREE); finish_handler (NULL_TREE);
......
// Build don't link:
// Origin: Mark Mitchell <mark@codesourcery.com>
template <class T = int>
struct S
{
void f ()
{
try {
} catch (int) {
}
}
};
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