[Issue 6636] New: Destructors of static array elements are not called on function parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 9 09:11:02 PDT 2011


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

           Summary: Destructors of static array elements are not called on
                    function parameter
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2011-09-09 09:10:48 PDT ---
static int sdtor;

struct S
{
    ~this()
    {
        ++sdtor;
    }
}

void func(S[3] sa)
{
    // sa should be destructed at the end of func()
}

void main()
{
    sdtor = 0;

    S[3] sa;
    func(sa);
    assert(sdtor == 3);
}

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


More information about the Digitalmars-d-bugs mailing list