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

           Summary: Declaration inside if condition doesn't call
                    destructor
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara <k.hara...@gmail.com> 2011-04-18 20:31:44 PDT ---
Test code:
----
import std.stdio;
struct S
{
    ~this(){ writeln("S.dtor"); }
    bool opCast(T:bool)(){ return true; }
}
void main()
{
    if (auto s = S())
    {
        // s.~this is not called.
    }
    else assert(0);
}
----

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

Reply via email to