Bug 11246 – [REG 2.063] Struct initialized in constructor is destroyed first

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-13T12:01:00Z
Last change time
2013-10-14T20:54:11Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
code
Depends on
9665

Attachments

IDFilenameSummaryContent-TypeSize
1263repro.drepro casetext/x-dsrc248

Comments

Comment #0 by code — 2013-10-13T12:01:22Z
Created attachment 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.
Comment #1 by code — 2013-10-13T12:16:07Z
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
Comment #2 by k.hara.pg — 2013-10-14T06:33:43Z
Comment #3 by github-bugzilla — 2013-10-14T20:51:25Z
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