[Bug c++/69902] [6 Regression] Bogus -Wnonnull-compare for: dynamic_cast<T*>(&ref) == nullptr

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 23 12:59:00 GMT 2016


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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Tue Feb 23 12:58:53 2016
New Revision: 233631

URL: https://gcc.gnu.org/viewcvs?rev=233631&root=gcc&view=rev
Log:
        PR c++/69902
        * fold-const.c (fold_truth_not_expr): Propagate TREE_NO_WARNING
        when inverting comparison.

        * g++.dg/warn/Wnonnull-compare-5.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/warn/Wnonnull-compare-5.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fold-const.c
    trunk/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list