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


Kenji Hara <k.hara...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code


--- Comment #2 from Kenji Hara <k.hara...@gmail.com> 2012-10-31 11:54:36 PDT ---
In Windows, s1's dtor causes Access Violation, but s2's dtor runs successfully.

import core.stdc.stdio : printf;
void main()
{
    bool destructorCalled = false;
    struct DestructorCounter
    {
        ~this()
        {
            printf("-dtor\n");
            destructorCalled = true; // segmentation fault
        }
    }
    struct S
    {
        DestructorCounter a;
    }
    S s1;       // Access Violation
    S s2 = S(); // OK
}

Output:
---
-dtor            (s2's dtor call)
-dtor            (s1's dtor call)
object.Error: Access Violation
---

I think this is definitely a wrong-code bug.

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

Reply via email to