Thread overview
[Issue 5859] New: Declaration inside if condition doesn't call destructor
Apr 19, 2011
Kenji Hara
Apr 22, 2011
Kenji Hara
Jun 04, 2011
Walter Bright
April 19, 2011
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: nobody@puremagic.com
        ReportedBy: k.hara.pg@gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg@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: -------
April 22, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5859



--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2011-04-22 04:17:09 PDT ---
Created an attachment (id=947)
test cases.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 04, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5859


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2011-06-04 11:40:23 PDT ---
See: https://github.com/9rnsr/dmd/commit/5f11cd1ce43b43562f88f05b8bedc3c382db56b5

https://github.com/D-Programming-Language/dmd/commit/e35d337d42525fdd4deaffa327fd8da3083baa37

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