diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2001-11-13 21:05:57 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2001-11-13 21:05:57 +0000 |
commit | b02922a4e3bcbb73a8c223a2a89ebc82f70314ab (patch) | |
tree | 7070a235359e569768ce78545f09ea5a0d1efab7 /gcc/cp/parse.y | |
parent | 4a4ae922546d1108be6301a155a86627911d4da4 (diff) | |
download | gcc-b02922a4e3bcbb73a8c223a2a89ebc82f70314ab.zip gcc-b02922a4e3bcbb73a8c223a2a89ebc82f70314ab.tar.gz gcc-b02922a4e3bcbb73a8c223a2a89ebc82f70314ab.tar.bz2 |
re PR c++/4206 (ICE with switch in while)
cp:
PR g++/4206
* parse.y (already_scoped_stmt): Remove.
(simple_stmt, WHILE & FOR): Use implicitly_scoped_stmt.
testsuite:
* g++.dg/other/forscope1.C: New test.
* g++.dg/ext/forscope1.C: New test.
* g++.dg/ext/forscope2.C: New test.
From-SVN: r46992
Diffstat (limited to 'gcc/cp/parse.y')
-rw-r--r-- | gcc/cp/parse.y | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index 1cf0020..12e8e26 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -1187,16 +1187,6 @@ compstmtend: | maybe_label_decls error '}' ; -already_scoped_stmt: - save_lineno '{' - { $<ttype>$ = begin_compound_stmt (1); } - compstmtend - { STMT_LINENO ($<ttype>3) = $1; - finish_compound_stmt (1, $<ttype>3); } - | save_lineno simple_stmt - { if ($2) STMT_LINENO ($2) = $1; } - ; - nontrivial_exprlist: expr_no_commas ',' expr_no_commas { $$ = tree_cons (NULL_TREE, $$, @@ -3394,7 +3384,7 @@ simple_stmt: } paren_cond_or_null { finish_while_stmt_cond ($3, $<ttype>2); } - already_scoped_stmt + implicitly_scoped_stmt { $$ = $<ttype>2; finish_while_stmt ($<ttype>2); } | DO @@ -3415,7 +3405,7 @@ simple_stmt: { finish_for_cond ($6, $<ttype>2); } xexpr ')' { finish_for_expr ($9, $<ttype>2); } - already_scoped_stmt + implicitly_scoped_stmt { $$ = $<ttype>2; finish_for_stmt ($<ttype>2); } | SWITCH |