www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17725] New: [scope] escape from nested function to enclosing

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

          Issue ID: 17725
           Summary: [scope] escape from nested function to enclosing local
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

From Rainer:
void test() safe { int* p; struct T { int a; } void escape(ref T t) safe { p = &t.a; // should not compile } { T t; escape(t); } auto bug = *p; } Compile with -dip1000 --
Aug 06 2017