[Issue 24157] [REG2.105] class `this` as lvalue leads to memory corruption

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 25 18:07:28 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=24157

--- Comment #1 from kinke <kinke at gmx.net> ---
Interestingly, this does NOT return a ref (the correct thing to do - the `this`
class ref is passed in a CPU register):

```
class Promise {
  auto ref unshared() {
    return this;
  }
}
```

--


More information about the Digitalmars-d-bugs mailing list