On Tuesday, 15 November 2022 at 02:49:55 UTC, Mike Parker wrote:
It's not the scope that matters here. It's the stack. Memory allocated in the inner scope uses the function stack, so it's all valid until the function exits.
And that was just so, so wrong. Of course destructors get called when scopes exit, etc.