Today I was playing with my -Wlogical-not-parentheses warning and
unfortunately I discovered two bugs:
1) if we have an expression consisting of more binary subexpression,
such as "n > 5 || !n < 10", we don't warn for the second subexpr,
because the code looked for "!" only on the very first
On Fri, 22 Aug 2014, Marc Glisse wrote:
On Fri, 22 Aug 2014, Jason Merrill wrote:
On 08/22/2014 03:24 PM, Marc Glisse wrote:
Note that there is a patch waiting for a review that makes us accept !v
for vector v:
Ah, indeed. I still think we might as well treat vectors the same as other
typ
Could we set current.lhs_type to TRUTH_NOT_EXPR when we see a ! rather
than track nots in two separate local variables?
Jason
On Wed, Aug 20, 2014 at 02:36:21PM -0400, Jason Merrill wrote:
> Could we set current.lhs_type to TRUTH_NOT_EXPR when we see a ! rather than
> track nots in two separate local variables?
Good point. So like the following? I haven't had time to run the full
regtest/bootstrap cycle yet, but at lea
On 08/20/2014 04:02 PM, Marek Polacek wrote:
On Wed, Aug 20, 2014 at 02:36:21PM -0400, Jason Merrill wrote:
Could we set current.lhs_type to TRUTH_NOT_EXPR when we see a ! rather than
track nots in two separate local variables?
Good point. So like the following?
I was thinking to do away wi
On Wed, Aug 20, 2014 at 05:02:24PM -0400, Jason Merrill wrote:
> On 08/20/2014 04:02 PM, Marek Polacek wrote:
> >On Wed, Aug 20, 2014 at 02:36:21PM -0400, Jason Merrill wrote:
> >>Could we set current.lhs_type to TRUTH_NOT_EXPR when we see a ! rather than
> >>track nots in two separate local variab
On 08/21/2014 11:41 AM, Marek Polacek wrote:
+ current.lhs_type = cp_lexer_next_token_is (parser->lexer, CPP_NOT)
+? TRUTH_NOT_EXPR : ERROR_MARK;
...
+ rhs_type = cp_lexer_next_token_is (parser->lexer, CPP_NOT)
+? TRUTH_NOT_EXPR : ERROR_MARK;
Again, t
On Thu, Aug 21, 2014 at 02:34:54PM -0400, Jason Merrill wrote:
> On 08/21/2014 11:41 AM, Marek Polacek wrote:
> >+ current.lhs_type = cp_lexer_next_token_is (parser->lexer, CPP_NOT)
> >+ ? TRUTH_NOT_EXPR : ERROR_MARK;
> ...
> >+ rhs_type = cp_lexer_next_token_is (parser->lexer
HI,
On 08/22/2014 04:48 PM, Marek Polacek wrote:
+ current.lhs_type = (cp_lexer_next_token_is (parser->lexer, CPP_NOT))
+? TRUTH_NOT_EXPR : ERROR_MARK;
IMHO, you want to close the parenthesis later, right before the semicolon.
Paolo.
On Fri, Aug 22, 2014 at 04:53:53PM +0200, Paolo Carlini wrote:
> HI,
>
> On 08/22/2014 04:48 PM, Marek Polacek wrote:
> >+ current.lhs_type = (cp_lexer_next_token_is (parser->lexer, CPP_NOT))
> >+ ? TRUTH_NOT_EXPR : ERROR_MARK;
> IMHO, you want to close the parenthesis later, righ
On 08/22/2014 11:59 AM, Marek Polacek wrote:
+ if (TREE_CODE (current.lhs) == INTEGER_CST)
+ warn_logical_not_parentheses (current.loc, current.tree_type,
+ current.lhs, rhs);
+ else if (EXPR_P (current.lhs))
+ warn_logic
On Fri, Aug 22, 2014 at 12:24:16PM -0400, Jason Merrill wrote:
> On 08/22/2014 11:59 AM, Marek Polacek wrote:
> >+ if (TREE_CODE (current.lhs) == INTEGER_CST)
> >+warn_logical_not_parentheses (current.loc, current.tree_type,
> >+ current.lhs, rhs);
On 08/22/2014 12:33 PM, Marek Polacek wrote:
On Fri, Aug 22, 2014 at 12:24:16PM -0400, Jason Merrill wrote:
Sorry to nitpick, but now that we aren't checking the lhs for BOOLEAN_TYPE,
do we need to look at it at all?
I believe so: if the LHS is an INTEGER_CST, we can't use TREE_OPERAND
on it.
On Fri, Aug 22, 2014 at 12:52:51PM -0400, Jason Merrill wrote:
> On 08/22/2014 12:33 PM, Marek Polacek wrote:
> >On Fri, Aug 22, 2014 at 12:24:16PM -0400, Jason Merrill wrote:
> >>Sorry to nitpick, but now that we aren't checking the lhs for BOOLEAN_TYPE,
> >>do we need to look at it at all?
> >
>
OK, thanks.
Jason
On 08/22/2014 03:24 PM, Marc Glisse wrote:
Note that there is a patch waiting for a review that makes us accept !v
for vector v:
Ah, indeed. I still think we might as well treat vectors the same as
other types here.
Jason
On Fri, 22 Aug 2014, Marek Polacek wrote:
On Fri, Aug 22, 2014 at 12:52:51PM -0400, Jason Merrill wrote:
On 08/22/2014 12:33 PM, Marek Polacek wrote:
On Fri, Aug 22, 2014 at 12:24:16PM -0400, Jason Merrill wrote:
Sorry to nitpick, but now that we aren't checking the lhs for BOOLEAN_TYPE,
do w
On Fri, 22 Aug 2014, Jason Merrill wrote:
On 08/22/2014 03:24 PM, Marc Glisse wrote:
Note that there is a patch waiting for a review that makes us accept !v
for vector v:
Ah, indeed. I still think we might as well treat vectors the same as other
types here.
Ok, now that it is a conscious
18 matches
Mail list logo