[Issue 20656] New: cannot compile live function without -preview=dip1021

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 9 23:06:13 UTC 2020


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

          Issue ID: 20656
           Summary: cannot compile live function without -preview=dip1021
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: kubo39 at gmail.com

Code:

---
import core.stdc.stdlib : free, malloc;

@live
void main()
{
    auto p = malloc(1);
    free(p);
    free(p);
}
---

Output:

---
$ dmd bugfix.d
bugfix.d(8): Error: variable bugfix.main.p has undefined state and cannot be
read
bugfix.d(8): Error: variable bugfix.main.p is not Owner, cannot consume its
value
---

--


More information about the Digitalmars-d-bugs mailing list