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]

Re: [PING^3] [C++] PR 15787 Poor error message with if and blocks


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


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