[Issue 19721] New: Cannot take address of scope local variable even with dip1000 if a member variable is a delegate

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 6 11:06:05 UTC 2019


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

          Issue ID: 19721
           Summary: Cannot take address of scope local variable even with
                    dip1000 if a member variable is a delegate
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: atila.neves at gmail.com

This code doesn't compile even with -dip1000 on dmd 2.085.0:


-----------------------------------
void main() @safe {
    scope s = Struct();
    func(&s);
}

private struct Struct {
    void delegate(int) dg;
}


void func(scope Struct* clientData) @safe nothrow {

}
-----------------------------------

It compiles if the `dg` member variable is removed or replaced with, say, an
int.

--


More information about the Digitalmars-d-bugs mailing list