This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/65323] [4.8/4.9/5 Regression] duplicate -Wzero-as-null-pointer-constant warnings
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Mar 2015 15:24:31 +0000
- Subject: [Bug c++/65323] [4.8/4.9/5 Regression] duplicate -Wzero-as-null-pointer-constant warnings
- Auto-submitted: auto-generated
- References: <bug-65323-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65323
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
I sent a patch to the mailing list about this. If we don't want to apply it and
we want to be super-conservative, we can indeed simply do this, with a comment,
in my opinion:
@@ -11227,11 +11243,14 @@
LOOKUP_IMPLICIT);
--cp_unevaluated_operand;
+ /* FIXME: should be OK to just check
+ TYPE_PTR_OR_PTRMEM_P (decl_type) && null_ptr_cst_p (arg). */
if (warn_zero_as_null_pointer_constant
&& TYPE_PTR_OR_PTRMEM_P (decl_type)
&& null_ptr_cst_p (arg)
&& (complain & tf_warning)
- && maybe_warn_zero_as_null_pointer_constant (arg, input_location))
+ && c_inhibit_evaluation_warnings == 0
+ && !NULLPTR_TYPE_P (TREE_TYPE (arg)))
return nullptr_node;
/* [dcl.fct.default]