https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103827

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #5)
> (In reply to Jan Hubicka from comment #4)
> > What about escape bits? Is it OK to save the address to global memory
> > and then check it in the destructor?
> 
> Yes, but does that matter? After the function returns the pointer is invalid
> and can't be used for anything. It's just an invalid pointer value that
> happens to be correctly aligned for the parameter type.

To be precise, in our implementation the pointer is invalid after the end of
the full-expression that contains the call (implementation-defined per
https://eel.is/c++draft/expr.call#6).

Reply via email to