www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19285] New: false positive GC inferred

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

          Issue ID: 19285
           Summary: false positive GC inferred
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: eyal weka.io

No GC is actually used here:

void f(bool cond, string s)  nogc {
    auto inner() { return s; }
    alias Unused1 = typeof(inner); // OK
    alias Unused2 = typeof(&inner); // INFERS GC
}

This is especially interesting when trying to use functionAttribute!inner and
others that internally "take address" (not really) of the given function and
wrongly infer GC is needed.

--
Oct 02 2018