diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-02-17 23:27:24 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-02-17 23:27:24 +0100 |
commit | 932c0da42d36625559d7997b392b0d08869dc649 (patch) | |
tree | b906ddcc4aab6686c41e92f405908b6c5569564d /gcc/cp/init.c | |
parent | 0f02dd56f5f50238244a729bde63387d42c36d63 (diff) | |
download | gcc-932c0da42d36625559d7997b392b0d08869dc649.zip gcc-932c0da42d36625559d7997b392b0d08869dc649.tar.gz gcc-932c0da42d36625559d7997b392b0d08869dc649.tar.bz2 |
re PR c++/69850 (unnecessary -Wnonnull-compare warning)
PR c++/69850
* gimplify.c (gimplify_cond_expr): Call gimple_set_no_warning
on the cond_stmt from TREE_NO_WARNING on COND_EXPR_COND.
* gimple-ssa-nonnull-compare.c (do_warn_nonnull_compare): Don't
warn on gimple_no_warning_p statements.
* init.c (build_delete): Set TREE_NO_WARNING on ifexp.
* g++.dg/warn/Wnonnull-compare-1.C: New test.
From-SVN: r233508
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r-- | gcc/cp/init.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 9f9c729..68cc1a7 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -4525,6 +4525,10 @@ build_delete (tree otype, tree addr, special_function_kind auto_delete, complain)); if (ifexp == error_mark_node) return error_mark_node; + /* This is a compiler generated comparison, don't emit + e.g. -Wnonnull-compare warning for it. */ + else if (TREE_CODE (ifexp) == NE_EXPR) + TREE_NO_WARNING (ifexp) = 1; } if (ifexp != integer_one_node) |