18 Feb
2022
18 Feb
'22
9:39 p.m.
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.