https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69922
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Target Milestone|--- |6.0 Summary|Bogus -Wnonnull-compare |[6 Regression] Bogus |for: ... ? |-Wnonnull-compare for: ... |static_cast<T*>(this) : |? static_cast<T*>(this) : |nullptr |nullptr --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Most likely it is due to multiple inheritance which causes GCC internally to emit a comparison and GCC decides to warn about that comparison when it should not.