diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-10 23:40:57 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-10 23:40:57 +0000 |
commit | 106c3d67d09f93142fbcc2507b54790c8b38c656 (patch) | |
tree | b7a1fda6293692106c060179365c03b8f2af725b /gcc/cp/cvt.c | |
parent | 544db64f1b123e87d643578cd9362d4ef847cee4 (diff) | |
download | gcc-106c3d67d09f93142fbcc2507b54790c8b38c656.tar.gz |
2013-11-10 Paolo Carlini <paolo.carlini@oracle.com>
* cvt.c (cp_convert_to_pointer): Call build_ptrmemfunc before
maybe_warn_zero_as_null_pointer_constant to avoid duplicate
-Wzero-as-null-pointer-constant diagnostics.
* typeck.c (build_ptrmemfunc): Use cp_build_c_cast.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204655 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 08c026da178..7dac108db95 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -203,13 +203,13 @@ cp_convert_to_pointer (tree type, tree expr, tsubst_flags_t complain) if (null_ptr_cst_p (expr)) { - if (complain & tf_warning) - maybe_warn_zero_as_null_pointer_constant (expr, loc); - if (TYPE_PTRMEMFUNC_P (type)) return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0, /*c_cast_p=*/false, complain); + if (complain & tf_warning) + maybe_warn_zero_as_null_pointer_constant (expr, loc); + /* A NULL pointer-to-data-member is represented by -1, not by zero. */ tree val = (TYPE_PTRDATAMEM_P (type) |