mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
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
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
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));
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
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
|
||||
|
||||
9
gcc/testsuite/g++.dg/pr68831.C
Normal file
9
gcc/testsuite/g++.dg/pr68831.C
Normal file
@@ -0,0 +1,9 @@
|
||||
// PR c++/68831
|
||||
// { dg-options "-Waddress" }
|
||||
|
||||
class DenseMap {
|
||||
public:
|
||||
~DenseMap();
|
||||
};
|
||||
extern const DenseMap &GCMap;
|
||||
void foo() { delete &GCMap; }
|
||||
Reference in New Issue
Block a user