diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2011-11-22 15:04:27 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2011-11-22 15:04:27 +0000 |
commit | 51e355aaab653803df5c3b81838d6d1b9f7a549e (patch) | |
tree | 04a8b14719d7a1746887c418387b0ae9f97356ff | |
parent | 56cb44d47d1180d630838c5b8f5396c2bcd460ec (diff) | |
download | gcc-51e355aaab653803df5c3b81838d6d1b9f7a549e.zip gcc-51e355aaab653803df5c3b81838d6d1b9f7a549e.tar.gz gcc-51e355aaab653803df5c3b81838d6d1b9f7a549e.tar.bz2 |
re PR c++/51196 (FAIL: g++.dg/cpp0x/Wzero-as-null-pointer-constant-1.C)
2011-11-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51196
* typeck.c (cp_build_binary_op, [case EQ_EXPR]): For targets having
TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_delta, do here
the -Wzero-as-null-pointer-constant warning for pmf == 0.
From-SVN: r181620
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0d729a9..e797a74 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2011-11-22 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/51196 + * typeck.c (cp_build_binary_op, [case EQ_EXPR]): For targets having + TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_delta, do here + the -Wzero-as-null-pointer-constant warning for pmf == 0. + 2011-11-21 Torvald Riegel <triegel@redhat.com> * pt.c (tsubst_copy_and_build): Handle TRANSACTION_EXPR. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index a23e274..9a5365c 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4056,6 +4056,13 @@ cp_build_binary_op (location_t location, delta0, integer_one_node, complain); + + if ((complain & tf_warning) + && c_inhibit_evaluation_warnings == 0 + && !NULLPTR_TYPE_P (TREE_TYPE (op1))) + warning (OPT_Wzero_as_null_pointer_constant, + "zero as null pointer constant"); + e2 = cp_build_binary_op (location, EQ_EXPR, e2, integer_zero_node, complain); |