https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99251
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Martin Sebor <mse...@gcc.gnu.org>: https://gcc.gnu.org/g:66ecb059c9d77cfcfb06cbdc3cac6a63b9e67f3d commit r11-7458-g66ecb059c9d77cfcfb06cbdc3cac6a63b9e67f3d Author: Martin Sebor <mse...@redhat.com> Date: Tue Mar 2 11:12:50 2021 -0700 PR c++/99251 - inconsistent -Wnonnull warning behaviour with dynamic_cast gcc/cp/ChangeLog: PR c++/99251 * class.c (build_base_path): Call build_if_nonnull. * cp-tree.h (build_if_nonnull): Declare. * rtti.c (ifnonnull): Rename... (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR. (build_dynamic_cast_1): Adjust to name change. gcc/testsuite/ChangeLog: PR c++/99251 * g++.dg/warn/Wnonnull9.C: Expect no warnings. * g++.dg/warn/Wnonnull12.C: New test.