[Bug c++/70295] [6 Regression] bogus -Wnonnull-compare for "dynamic_cast<const FuSelection *>(this) != nullptr"

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 22 08:11:00 GMT 2016


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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Tue Mar 22 08:11:14 2016
New Revision: 234392

URL: https://gcc.gnu.org/viewcvs?rev=234392&root=gcc&view=rev
Log:
        PR c++/70295
        * gimplify.c (gimplify_modify_expr): Call gimple_set_no_warning
        on assign if (*from_p) is a comparison, set it to
        TREE_NO_WARNING (*from_p).

        * c-c++-common/nonnull-1.c (func): Remove parens around cp4 != 0.
        (func2): New function for cond with parens, xfail warning for c++.
        * g++.dg/warn/Wnonnull-compare-8.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/warn/Wnonnull-compare-8.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/c-c++-common/nonnull-1.c


More information about the Gcc-bugs mailing list