diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2007-01-30 22:29:11 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2007-01-30 22:29:11 +0000 |
commit | b9edb4b11c99720e10625b41d37dc440bd468f2c (patch) | |
tree | 6ab5f599b4f4444b77112bd54a7ebdc103ca2f51 /gcc/cp/call.c | |
parent | 14734fc701357c82967954578c822f3ddede043f (diff) | |
download | gcc-b9edb4b11c99720e10625b41d37dc440bd468f2c.zip gcc-b9edb4b11c99720e10625b41d37dc440bd468f2c.tar.gz gcc-b9edb4b11c99720e10625b41d37dc440bd468f2c.tar.bz2 |
re PR c++/24745 (unpleasant warning for "if (NULL)")
2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c++/24745
* doc/invoke.texi (Wpointer-arith): Document warning.
cp/
* typeck.c (build_binary_op): Fix logic for warning. Move warning
to -Wpointer-arith.
* call.c (convert_like_real): Don't warn when converting to
boolean type.
testsuite/
* g++.dg/warn/null4.C: New.
From-SVN: r121361
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 55ae284..ac29ecd 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4250,7 +4250,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, tree t = non_reference (totype); /* Issue warnings about peculiar, but valid, uses of NULL. */ - if (ARITHMETIC_TYPE_P (t) && expr == null_node) + if (expr == null_node && TREE_CODE (t) != BOOLEAN_TYPE && ARITHMETIC_TYPE_P (t)) { if (fn) warning (OPT_Wconversion, "passing NULL to non-pointer argument %P of %qD", |