http://d.puremagic.com/issues/show_bug.cgi?id=11382

           Summary: Bad closure variable with scoped destruction
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Kenji Hara <[email protected]> 2013-10-29 21:32:40 PDT ---
In the following code, compiler should reject the function 'foo' by
"has scoped destruction, cannot build closure" error.

struct S
{
    ~this() {}
}

auto foo()
{
    S s = S();
    return { s = S(); };
}

void main() {}

It is checked in toir.c FuncDeclaration::buildClosure(), however currently it
doesn't work for the variables which are explicitly declared on statement.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to