--- Comment #3 from CVS Commits <cvs-commit at gcc dot> ---
The master branch has been updated by Patrick Palka <>:

commit r10-7379-gc7a252ba2d0a08397d8fc6d6dc7db34f90f76acb
Author: Patrick Palka <>
Date:   Wed Mar 25 12:32:43 2020 -0400

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

    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
    patch takes the route of unconditionally invalidating the condition chain
    it encounters such an if-statement.


            PR c++/94265
            * parser.c (cp_parser_selection_statement) <case RID_IF>:
Invalidate the
            current condition chain when the if-statement has a non-empty


            PR c++/94265
            * g++.dg/warn/Wduplicated-cond1.C: New test.

Reply via email to