diff options
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) |