Commit 458cd4c3 by Patrick Palka

Fix PR c++/68831 (superfluous -Waddress warning for C++ delete)

gcc/cp/ChangeLog:

	PR c++/68831
	* init.c (build_delete): Use a warning sentinel to disable
	-Waddress warnings when building the conditional that tests
	if the operand is NULL.

gcc/testsuite/ChangeLog:

	PR c++/68831
	* g++.dg/pr68831.C: New test.

From-SVN: r231798
parent 474c8a07
2015-12-18 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/68831
* init.c (build_delete): Use a warning sentinel to disable
-Waddress warnings when building the conditional that tests
if the operand is NULL.
2015-12-17 Jason Merrill <jason@redhat.com>
PR c++/67550
......
......@@ -4449,6 +4449,7 @@ build_delete (tree otype, tree addr, special_function_kind auto_delete,
else
{
/* Handle deleting a null pointer. */
warning_sentinel s (warn_address);
ifexp = fold (cp_build_binary_op (input_location,
NE_EXPR, addr, nullptr_node,
complain));
......
2015-12-18 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/68831
* g++.dg/pr68831.C: New test.
2015-12-17 Jeff Law <law@redhat.com>
* gcc.dg/tree-ssa/split-path-1.c: Explicitly ask for path
......
// PR c++/68831
// { dg-options "-Waddress" }
class DenseMap {
public:
~DenseMap();
};
extern const DenseMap &GCMap;
void foo() { delete &GCMap; }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment