Re: [C/C++ PATCH] PR c++/66572. Fix Wlogical-op false positive

2015-07-23 Thread Jeff Law
On 07/21/2015 04:56 AM, Marek Polacek wrote: Ping. On Tue, Jul 14, 2015 at 06:38:12PM +0200, Marek Polacek wrote: Ok, in that case I think easiest would the following (I hit the same issue when writing the -Wtautological-compare patch): Bootstrapped/regtested on x86_64-linux, ok for trunk? 20

Re: [C/C++ PATCH] PR c++/66572. Fix Wlogical-op false positive

2015-07-21 Thread Marek Polacek
Ping. On Tue, Jul 14, 2015 at 06:38:12PM +0200, Marek Polacek wrote: > Ok, in that case I think easiest would the following (I hit the same issue > when writing the -Wtautological-compare patch): > > Bootstrapped/regtested on x86_64-linux, ok for trunk? > > 2015-07-14 Marek Polacek > >

Re: [C/C++ PATCH] PR c++/66572. Fix Wlogical-op false positive

2015-07-15 Thread Mikhail Maltsev
On 07/14/2015 07:38 PM, Marek Polacek wrote: > Ok, in that case I think easiest would the following (I hit the same issue > when writing the -Wtautological-compare patch): Thanks for taking care of this issue. -- Regards, Mikhail Maltsev

Re: [C/C++ PATCH] PR c++/66572. Fix Wlogical-op false positive

2015-07-14 Thread Marek Polacek
Sorry it's taken so long to respond. On Wed, Jun 24, 2015 at 05:43:05PM +0300, Mikhail Maltsev wrote: > > That looks wrong, because with TREE_CONSTANT we'd warn in C but not in C++ > > for the following: > > > > const int a = 4; > > void > > f (void) > > { > > const int b = 4; > > static cons

Re: [C/C++ PATCH] PR c++/66572. Fix Wlogical-op false positive

2015-06-24 Thread Mikhail Maltsev
On 23.06.2015 22:49, Marek Polacek wrote: > On Sat, Jun 20, 2015 at 03:02:06AM +0300, Mikhail Maltsev wrote: >> - /* We do not warn for constants because they are typical of macro >> - expansions that test for features. */ >> - if (CONSTANT_CLASS_P (op_left) || CONSTANT_CLASS_P (op_right)) >

Re: [C/C++ PATCH] PR c++/66572. Fix Wlogical-op false positive

2015-06-23 Thread Marek Polacek
On Sat, Jun 20, 2015 at 03:02:06AM +0300, Mikhail Maltsev wrote: > - /* We do not warn for constants because they are typical of macro > - expansions that test for features. */ > - if (CONSTANT_CLASS_P (op_left) || CONSTANT_CLASS_P (op_right)) > + /* We do not warn for literal constants bec

[C/C++ PATCH] PR c++/66572. Fix Wlogical-op false positive

2015-06-19 Thread Mikhail Maltsev
Hi. In current implementation we avoid giving "logical and/or of equal expressions" warning for literal constant operands. The attached patch fixes the check to make it treat const-qualified VAR_DECLs with constant initializers the same way. Bootstrapped and regtested on x86_64-linux. OK for trunk