re PR c++/65323 (duplicate -Wzero-as-null-pointer-constant warnings)
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 12 Mar 2015 23:55:49 +0000 (23:55 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 12 Mar 2015 23:55:49 +0000 (23:55 +0000)
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

gcc/cp/ChangeLog
gcc/cp/decl.c

index f350705c3767ea404edbeaadbb3803d11f132857..259ce9c9839bd072dfeae913c0e1ef1d4edf7974 100644 (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.
index 54e6418b32277c9e63fd9f2ce75bbad15fba6c7e..e35e48436dc0a6016c41d922ad76c7e172c76983 100644 (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]