This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING^3] [C++] PR 15787 Poor error message with if and blocks
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Nathan Sidwell <nathan at codesourcery dot com>
- Date: Thu, 01 Mar 2007 20:26:13 -0800
- Subject: Re: [PING^3] [C++] PR 15787 Poor error message with if and blocks
- References: <6c33472e0702100619s9fe3d20t9fda1ef0fa204c0b@mail.gmail.com> <6c33472e0702180343u60566f73kadcea2a2dee3d789@mail.gmail.com> <6c33472e0703011015u1e0bd6e7q4768567c1a7e1554@mail.gmail.com>
Manuel López-Ibáñez wrote:
> Following discussion with Mark Mitchell.
> http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02320.html
>
> PING^3: http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02533.html
> - switch (parser->in_statement)
> + switch (parser->in_statement & ~IN_IF_STMT)
> {
> case 0:
> error ("break statement not within loop or switch");
> break;
> default:
> - gcc_assert ((parser->in_statement & IN_SWITCH_STMT)
> - || parser->in_statement == IN_ITERATION_STMT);
> + gcc_assert (((parser->in_statement & ~IN_IF_STMT) & IN_SWITCH_STMT)
> + || (parser->in_statement & ~IN_IF_STMT) == IN_ITERATION_STMT);
Please create a temporary for parser->in_statement & ~IN_IF_STMT, so
that you don't need to add that & ~IN_IF_STMT in all uses. The patch is
OK with that change; please update and check in.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713