This is the mail archive of the gcc-bugs@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]

[Bug c++/15787] Poor error message with if and blocks



------- Comment #8 from manu at gcc dot gnu dot org  2007-03-03 15:32 -------
Subject: Bug 15787

Author: manu
Date: Sat Mar  3 15:32:13 2007
New Revision: 122505

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122505
Log:
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.

Added:
    trunk/gcc/testsuite/g++.dg/parse/else-2.C
    trunk/gcc/testsuite/g++.dg/parse/else.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15787


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