Thread overview
[Issue 11246] New: [REG 2.063] Struct initialized in constructor is destroyed first
Oct 13, 2013
Benjamin Thaut
Oct 13, 2013
Benjamin Thaut
Oct 14, 2013
Kenji Hara
Oct 15, 2013
Walter Bright
October 13, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11246

           Summary: [REG 2.063] Struct initialized in constructor is
                    destroyed first
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: code@benjamin-thaut.de


--- Comment #0 from Benjamin Thaut <code@benjamin-thaut.de> 2013-10-13 12:01:22 PDT ---
Created an attachment (id=1263)
repro case

When initializing a struct inside a constructor it is destroyed first. Initializling a struct within the constructor should be equal to:

auto var = StructType(5);

See attached repro case.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 13, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11246



--- Comment #1 from Benjamin Thaut <code@benjamin-thaut.de> 2013-10-13 12:16:07 PDT ---
To be more percise in dmd 2.062 and earlier the repro case would print

ctor 5
dtor

Starting with dmd 2.063 this prints

ctor
dtor
dtor

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 14, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11246


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

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


--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2013-10-14 06:33:43 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2665

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 15, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11246



--- Comment #3 from github-bugzilla@puremagic.com 2013-10-14 20:51:25 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/4a8ce87381a0bc0595b718681cdae5d7bc97f3cb
fix Issue 11246 - [REG 2.063] Struct initialized in constructor is destroyed
first

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 15, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11246


Walter Bright <bugzilla@digitalmars.com> changed:

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


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