Re: [PATCH v7] c++: Add diagnostic when operator= is used as truth cond [PR25689]

2022-03-24 Thread Jason Merrill via Gcc-patches
On 3/13/22 19:43, Zhao Wei Liew wrote: On Sat, 12 Mar 2022 at 06:15, Jason Merrill wrote: It looks good, but unfortunately regresses some other warning tests, such as Wnonnull5.C. Please remember to run the regression tests before sending a patch (https://gcc.gnu.org/contribute.html#testing).

Re: [PATCH v7] c++: Add diagnostic when operator= is used as truth cond [PR25689]

2022-03-13 Thread Zhao Wei Liew via Gcc-patches
On Sat, 12 Mar 2022 at 06:15, Jason Merrill wrote: > It looks good, but unfortunately regresses some other warning tests, > such as Wnonnull5.C. Please remember to run the regression tests before > sending a patch (https://gcc.gnu.org/contribute.html#testing). > > This seems to be a complicated p

Re: [PATCH v7] c++: Add diagnostic when operator= is used as truth cond [PR25689]

2022-03-11 Thread Jason Merrill via Gcc-patches
On 2/17/22 23:30, Zhao Wei Liew wrote: On Fri, 18 Feb 2022 at 08:32, Zhao Wei Liew wrote: +/* Test non-empty class */ +void f2(B b1, B b2) +{ + if (b1 = 0); /* { dg-warning "suggest parentheses" } */ + if (b1 = 0.); /* { dg-warning "suggest parentheses" } */ + if (b1 = b2); /* { dg-warning "s

Re: [PATCH v7] c++: Add diagnostic when operator= is used as truth cond [PR25689]

2022-02-17 Thread Zhao Wei Liew via Gcc-patches
On Fri, 18 Feb 2022 at 08:32, Zhao Wei Liew wrote: > > > >>> +/* Test non-empty class */ > > >>> +void f2(B b1, B b2) > > >>> +{ > > >>> + if (b1 = 0); /* { dg-warning "suggest parentheses" } */ > > >>> + if (b1 = 0.); /* { dg-warning "suggest parentheses" } */ > > >>> + if (b1 = b2); /* { dg-warn

Re: [PATCH v7] c++: Add diagnostic when operator= is used as truth cond [PR25689]

2022-02-17 Thread Zhao Wei Liew via Gcc-patches
On Thu, 17 Feb 2022 at 00:59, Jason Merrill wrote: > > On 2/16/22 02:16, Zhao Wei Liew wrote: > > On Wed Feb 16, 2022 at 4:06 AM +08, Jason Merrill wrote: > >>> Ah, I see. I found it a bit odd that gcc-commit-mklog auto-generated a > >>> subject with "c:", > >>> but I just went with it as I didn't

Re: [PATCH v7] c++: Add diagnostic when operator= is used as truth cond [PR25689]

2022-02-16 Thread Jason Merrill via Gcc-patches
On 2/16/22 02:16, Zhao Wei Liew wrote: On Wed Feb 16, 2022 at 4:06 AM +08, Jason Merrill wrote: Ah, I see. I found it a bit odd that gcc-commit-mklog auto-generated a subject with "c:", but I just went with it as I didn't know any better. Unfortunately, I can't change it now on the current threa

Re: [PATCH v7] c++: Add diagnostic when operator= is used as truth cond [PR25689]

2022-02-15 Thread Zhao Wei Liew via Gcc-patches
Before I start, sincere apologies for the email mishaps! I was setting up an email client and somehow the emails I sent did not initially seem to go through, but they actually did. You might have received several duplicate emails as a result. On Wed Feb 16, 2022 at 4:06 AM +08, Jason Merrill wrote