__rvalue and Move Semantics first draft - aliasing problem/danger
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Sun Nov 10 02:38:08 UTC 2024
On 10/11/2024 11:44 AM, Walter Bright wrote:
> Timon mentioned the related problem with:
>
> |callee(__rvalue s, __rvalue s); |
>
> where s would be destroyed twice. This isn't always detectable:
Break it down into an IR:
```
a = __rvalue(s)
b = __rvalue(s)
callee(a, b)
```
This is what type state analysis sees at an IR level.
```
// s must be >=initialized
a = s
// s is reachable which is < initialied
// s must be >= initialized, ERROR
b = s
```
We don't need to solve type state analysis here ;)
But it does tell us, that as a language feature it is dependent upon it,
to be working correctly, so can't be turned on until then.
More information about the dip.development
mailing list