On 1/15/26 3:17 PM, Jakub Jelinek wrote:
On Thu, Jan 15, 2026 at 12:56:58PM +0800, Jason Merrill wrote:
Preexisting issue, but I'm not sure why this function is trying so hard; why
do we need to do more than check that the _Zn? and _Zd? match?
There doesn't seem to be a definition of what a "valid" pair is.
I don't know, so just have to guess, that besides the _Zn? vs. _Zd? match
it wants a match in whether it is align_val_t vs. non-align_val_t pair.
And that comes from the standard,
https://eel.is/c++draft/new.delete#array-10
that one shouldn't delete without alignment argument something that
has been allocated with the alignment argument and vice versa (and that
the argument is the same, not sure if the warning checks it if
both are constant).
Ah, good point, I had forgotten about that.
--- gcc/tree.cc.jj 2026-01-12 09:58:18.748429069 +0100
+++ gcc/tree.cc 2026-01-12 19:21:33.465016103 +0100
@@ -15269,7 +15269,7 @@ verify_type_context (location_t loc, typ
/* Return true if NEW_ASM and DELETE_ASM name a valid pair of new and
delete operators. Return false if they may or may not name such
- a pair and, when nonnull, set *PCERTAIN to true if they certainly
+ a pair and, when false, set *PCERTAIN to true if they certainly
This change seems wrong; if pcertain is null we change a local variable
instead of anything from the function argument.
You're right, consider that hunk removed.
LGTM with that change.
Jason