This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR 15787 Poor error message with if and blocks


:ADDPATCH c++:

This patch tries to improve the error message obtained when an  'else'
is found where something else was expected.

This is my first patch for the C++ parser, so I am not sure whether
this is 100% correct. Nonetheless, bootstrapped and regression tested
with --enable-languages=all.

OK for mainline?

2007-01-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>

 PR c++/15787
cp/
 * parser.c (cp_parser_statement_seq_opt): Return as soon as we find
an unexpected 'else'.

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

Attachment: c++-parse-else.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]