Re: [PATCH] c++: Fix invalid -Wduplicated-cond warning [PR94265]

2020-03-25 Thread Jason Merrill via Gcc-patches
On 3/25/20 8:52 AM, Patrick Palka wrote: This fixes a false-positive warning from -Wduplicate-cond in the presence of an if-statement with a non-empty init-statement. Precisely determining whether a non-empty init-statement has side effects seems tricky and error-prone, so this > patch takes

Re: [PATCH] c++: Fix invalid -Wduplicated-cond warning [PR94265]

2020-03-25 Thread Patrick Palka via Gcc-patches
On Wed, 25 Mar 2020, Marek Polacek wrote: > On Wed, Mar 25, 2020 at 08:52:47AM -0400, Patrick Palka via Gcc-patches wrote: > > This fixes a false-positive warning from -Wduplicate-cond in the presence > > of an > > if-statement with a non-empty init-statement. Precisely determining > > whether

Re: [PATCH] c++: Fix invalid -Wduplicated-cond warning [PR94265]

2020-03-25 Thread Marek Polacek via Gcc-patches
On Wed, Mar 25, 2020 at 08:52:47AM -0400, Patrick Palka via Gcc-patches wrote: > This fixes a false-positive warning from -Wduplicate-cond in the presence of > an > if-statement with a non-empty init-statement. Precisely determining whether a > non-empty init-statement has side effects seems

[PATCH] c++: Fix invalid -Wduplicated-cond warning [PR94265]

2020-03-25 Thread Patrick Palka via Gcc-patches
This fixes a false-positive warning from -Wduplicate-cond in the presence of an if-statement with a non-empty init-statement. Precisely determining whether a non-empty init-statement has side effects seems tricky and error-prone, so this patch takes the route of unconditionally invalidating the