diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2015-03-12 23:55:49 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2015-03-12 23:55:49 +0000 |
commit | b7e7f412087e6682057ed98df6c466d5da342f6e (patch) | |
tree | fb53467b9325abc3044cb9606eb560226f05c16e /gcc | |
parent | 2960e09d9df2b5428711832d39d27b08abfdb7b6 (diff) | |
download | gcc-b7e7f412087e6682057ed98df6c466d5da342f6e.zip gcc-b7e7f412087e6682057ed98df6c466d5da342f6e.tar.gz gcc-b7e7f412087e6682057ed98df6c466d5da342f6e.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 9 |
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f350705..259ce9c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 54e6418..e35e484 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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] |