Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2022-02-18 21:39:25


Niall Douglas wrote:
> >>> I mean, effectively launder invokes "escaped" during escape analysis
> right?
...
> That's not clear, so I made a clearer example of when launder is actually
> needed: https://godbolt.org/z/na78G77jY.

That's a good demonstration of how launder() is needed because of
https://eel.is/c++draft/basic.memobj#basic.life-8, but it doesn't mean
that your claim above is correct.

The address is considered escaped in both cases. It's just that the
compiler is allowed to assume that this doesn't matter in the no-
launder case, because of the aforementioned basic.life#8.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk