2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 3 Mar 2007 15:32:13 +0000 (15:32 +0000)
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 3 Mar 2007 15:32:13 +0000 (15:32 +0000)
commit2672c56c19f6ec7ce067e7804cb4cda03a696dfd
treea37e403d644d8673beafbffae9500ca26a0f8fd2
parent2079f33def5f695b9db28594486a18757e6e23e4
2007-03-03  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

PR c++/15787
* parser.c (struct cp_parser): New IN_IF_STMT.
(cp_parser_statement_seq_opt): Handle an unexpected 'else',
returning if parsing the body of an 'if' statement or issuing an
error and continuing.
(cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
body of 'if'.
(cp_parser_jump_statement): Mask new IN_IF_STMT bit.

testsuite/
* g++.dg/parse/else.C: New.
* g++.dg/parse/else-2.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122505 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/else-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/else.C [new file with mode: 0644]