This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70295] [6 Regression] bogus -Wnonnull-compare for "dynamic_cast<const FuSelection *>(this) != nullptr"
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 Mar 2016 08:11:46 +0000
- Subject: [Bug c++/70295] [6 Regression] bogus -Wnonnull-compare for "dynamic_cast<const FuSelection *>(this) != nullptr"
- Auto-submitted: auto-generated
- References: <bug-70295-4 at http dot gcc dot gnu dot org/bugzilla/>
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