aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2021-08-14 13:25:41 -0600
committerMartin Sebor <msebor@redhat.com>2021-08-14 13:25:41 -0600
commit96194a07bdbc57dd9733892a791d87dbe25f0802 (patch)
treec3414d3d61a97e5d4d9dc33abe0f09149245f760 /gcc/tree.h
parent240f07805db27cfc746276039c5edccb4c031070 (diff)
downloadgcc-96194a07bdbc57dd9733892a791d87dbe25f0802.zip
gcc-96194a07bdbc57dd9733892a791d87dbe25f0802.tar.gz
gcc-96194a07bdbc57dd9733892a791d87dbe25f0802.tar.bz2
Diagnose mismatches between array and scalar new and delete [PR101791].
Resolves: PR middle-end/101791 - missing warning on a mismatch between scalar and array forms of new and delete gcc/ChangeLog: PR middle-end/101791 * gimple-ssa-warn-access.cc (new_delete_mismatch_p): Use new argument to valid_new_delete_pair_p. * tree.c (valid_new_delete_pair_p): Add argument. * tree.h (valid_new_delete_pair_p): Same. gcc/testsuite/ChangeLog: PR middle-end/101791 * g++.dg/warn/Wmismatched-new-delete-6.C: New test. * g++.dg/warn/Wmismatched-new-delete-7.C: New test.
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index c3f302a..a26500d 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5406,7 +5406,9 @@ extern bool gimple_canonical_types_compatible_p (const_tree, const_tree,
extern bool type_with_interoperable_signedness (const_tree);
extern bitmap get_nonnull_args (const_tree);
extern int get_range_pos_neg (tree);
-extern bool valid_new_delete_pair_p (tree, tree);
+
+/* Return true for a valid pair of new and delete operators. */
+extern bool valid_new_delete_pair_p (tree, tree, bool * = NULL);
/* Return simplified tree code of type that is used for canonical type
merging. */