Re: [PATCH] c++: Don't crash upon invalid placement new operator [PR117101]

2024-11-04 Thread Jason Merrill
On 11/1/24 1:22 PM, Simon Martin wrote: We currently crash upon the following invalid code (notice the "void void**" parameter) === cut here === using size_t = decltype(sizeof(int)); void *operator new(size_t, void void **p) noexcept { return p; } int x; void f() { int y; new (&y) int(

[PATCH] c++: Don't crash upon invalid placement new operator [PR117101]

2024-11-01 Thread Simon Martin
We currently crash upon the following invalid code (notice the "void void**" parameter) === cut here === using size_t = decltype(sizeof(int)); void *operator new(size_t, void void **p) noexcept { return p; } int x; void f() { int y; new (&y) int(x); } === cut here === The problem is that