diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2011-11-09 17:21:19 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2011-11-09 17:21:19 +0000 |
commit | 6d96d7ff5ec3d6bd88127ec0d5f5fa65fac5c650 (patch) | |
tree | d22ede289f9b12d71716ebb1a4b6667f9a7198a1 /gcc/cp | |
parent | db422ace3f052fe6c078db73c3699769e4ddde38 (diff) | |
download | gcc-6d96d7ff5ec3d6bd88127ec0d5f5fa65fac5c650.zip gcc-6d96d7ff5ec3d6bd88127ec0d5f5fa65fac5c650.tar.gz gcc-6d96d7ff5ec3d6bd88127ec0d5f5fa65fac5c650.tar.bz2 |
re PR c++/51045 (erroneous zero as null pointer constant warning at delete)
/cp
2011-11-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51045
* init.c (build_new_1, build_vec_delete_1, build_delete):
Use nullptr_node.
/testsuite
2011-11-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51045
* g++.dg/warn/Wzero-as-null-pointer-constant-2.C: New.
2011-11-09 Paolo Carlini <paolo.carlini@oracle.com>
* doc/invoke.texi ([Option Summary, C++ Language Options]):
Add -Wzero-as-null-pointer-constant.
From-SVN: r181214
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 25 | ||||
-rw-r--r-- | gcc/cp/init.c | 6 |
2 files changed, 28 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f7f91d2..7ebe23f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,28 @@ +2011-11-09 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/51045 + * init.c (build_new_1, build_vec_delete_1, build_delete): + Use nullptr_node. + +2011-11-09 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/51047 + * search.c (lookup_member): Change to take also a tsubst_flags_t + parameter. + (lookup_field, lookup_fnfields): Adjust calls. + * typeck.c (lookup_destructor, finish_class_member_access_expr, + build_ptrmemfunc_access_expr): Likewise. + * class.c (handle_using_decl, maybe_note_name_used_in_class): + Likewise. + * pt.c (resolve_typename_type): Likewise. + * semantics.c (lambda_function): Likewise. + * parser.c (cp_parser_perform_range_for_lookup, + cp_parser_lookup_name): Likewise. + * friend.c (make_friend_class): Likewise. + * name-lookup.c (pushdecl_maybe_friend_1, get_class_binding, + do_class_using_decl, lookup_qualified_name): Likewise. + * cp-tree.h (lookup_member): Adjust declaration. + 2011-11-09 Dodji Seketeli <dodji@redhat.com> PR c++/51027 diff --git a/gcc/cp/init.c b/gcc/cp/init.c index ca4f590..77fe42e 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2646,7 +2646,7 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts, { tree ifexp = cp_build_binary_op (input_location, NE_EXPR, alloc_node, - integer_zero_node, + nullptr_node, complain); rval = build_conditional_expr (ifexp, rval, alloc_node, complain); @@ -2958,7 +2958,7 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, fold_build2_loc (input_location, NE_EXPR, boolean_type_node, base, convert (TREE_TYPE (base), - integer_zero_node)), + nullptr_node)), body, integer_zero_node); body = build1 (NOP_EXPR, void_type_node, body); @@ -3685,7 +3685,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete, { /* Handle deleting a null pointer. */ ifexp = fold (cp_build_binary_op (input_location, - NE_EXPR, addr, integer_zero_node, + NE_EXPR, addr, nullptr_node, complain)); if (ifexp == error_mark_node) return error_mark_node; |