Bug 12045 – Destructor call omitted for NRVO'd struct in exceptional case

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-30T14:17:00Z
Last change time
2014-02-13T17:27:34Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
safety0ff.bugz

Attachments

IDFilenameSummaryContent-TypeSize
1318test12045.dBug demonstrationtext/x-dsrc612

Comments

Comment #0 by safety0ff.bugz — 2014-01-30T14:17:20Z
Created attachment 1318 Bug demonstration I was trying to work out how NRVO in DMD worked (to take a stab at #10929,) and it looked like it might be omitting the calls even when an exception is thrown, so I ran a test and it looks like it does omit them (See attached code.)
Comment #1 by k.hara.pg — 2014-02-01T08:41:22Z
Comment #2 by github-bugzilla — 2014-02-13T15:50:10Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3dc08b365d91f4cb70c7c31418c040ad6d4493a0 fix Issue 12045 - Destructor call omitted for NRVO'd struct in exceptional case https://github.com/D-Programming-Language/dmd/commit/a9ec782edfb80f8732cc5b1e903f85cab0959c7b Merge pull request #3184 from 9rnsr/fix12045 Issue 12045 - Destructor call omitted for NRVO'd struct in exceptional case