[Bug c++/79258] -Wduplicated-branches false positive?

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 8 21:27:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79258

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |msebor at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
I'd say the warning is valid.  The two branches are necessarily the same and
there's no way to make them be different because Base::state() and
Derived::state() are one and the same function, regardless of what object
m_Derived points at.  This looks to me a good example of where the warning is
particularly useful.  Thus I resolve this report as invalid.


More information about the Gcc-bugs mailing list