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 tricky and error-prone, so > this > patch takes the route of unconditionally invalidating the condition chain when > it encounters such an if-statement. > > Tested on x86_64-pc-linux-gnu, does this look OK?
This looks ok (can't approve but I wrote -Wduplicated-cond), thanks. > gcc/cp/ChangeLog: > > PR c++/94265 > * parser.c (cp_parser_selection_statement) [RID_IF]: Invalidate the We usually spell cases like <case RID_IF>, [ ] is for #ifdefs. Marek