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]