https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|ASSIGNED |RESOLVED --- Comment #17 from Martin Sebor <msebor at gcc dot gnu.org> --- Warnings for the static cast suppressed in r11-2457. The warning for the dynamic cast is still issued and I would suggest to use a cast to a reference instead, both to avoid it and as an indication that the cast is expected to succeed (or throw): if (mainloop_ && typeid(mainloop_) == typeid(M)) { dynamic_cast<M&>(*mainloop_).setup_M( );