re PR c++/65323 (duplicate -Wzero-as-null-pointer-constant warnings)

2015-03-12  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/65323
	* decl.c (check_default_argument): Don't call
	maybe_warn_zero_as_null_pointer_constant.

From-SVN: r221402
This commit is contained in:
Paolo Carlini 2015-03-12 23:55:49 +00:00 committed by Paolo Carlini
parent 2960e09d9d
commit b7e7f41208
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2015-03-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/65323
* decl.c (check_default_argument): Don't call
maybe_warn_zero_as_null_pointer_constant.
2015-03-11 Aldy Hernandez <aldyh@redhat.com>
* cp-gimplify.c (simple_empty_class_p): New.

View File

@ -11229,11 +11229,10 @@ check_default_argument (tree decl, tree arg, tsubst_flags_t complain)
LOOKUP_IMPLICIT);
--cp_unevaluated_operand;
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))
/* Avoid redundant -Wzero-as-null-pointer-constant warnings at
the call sites. */
if (TYPE_PTR_OR_PTRMEM_P (decl_type)
&& null_ptr_cst_p (arg))
return nullptr_node;
/* [dcl.fct.default]