Bug 16747 – [Reg 2.072] Cannot have stack allocated classes in @safe code

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-11-24T12:25:00Z
Last change time
2017-08-02T08:07:15Z
Assigned to
nobody
Creator
bugzilla
See also
https://issues.dlang.org/show_bug.cgi?id=16195

Comments

Comment #0 by bugzilla — 2016-11-24T12:25:23Z
The following fails: void foo() @safe { scope o = new Object(); } with: Error: delete o is not @safe but is used in @safe function foo because o is allocated on the stack and the destructor gets called. But in this case there is no destructor, and no deallocation, so the unsafe delete call is unnecessary. This problem was introduced by a fix to: https://issues.dlang.org/show_bug.cgi?id=16195 and change: https://github.com/dlang/dmd/commit/e64ae1d3e5aa078a036242864a68499617c9b278
Comment #1 by bugzilla — 2016-11-24T12:27:01Z
Regression discovered by Mathias Lang
Comment #2 by bugzilla — 2016-11-24T12:33:13Z
Comment #3 by code — 2016-12-10T15:43:29Z
Please add [Reg 2.0XX] tags, so we can easily see which version is affected. That tag must not include in the point release. For regressions on master use the upcoming version, e.g. [Reg 2.073] at the date of writing.
Comment #4 by github-bugzilla — 2016-12-15T12:40:47Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a07034f2fe3a50622fedc810cf0ac775bbbfe1d3 fix Issue 16747 - Cannot have stack allocated classes in @safe code https://github.com/dlang/dmd/commit/6936a2eca064847160b352ab7f4ab3251acd0d75 Merge pull request #6279 from WalterBright/fix16747 fix Issue 16747 - Cannot have stack allocated classes in @safe code
Comment #5 by github-bugzilla — 2016-12-18T22:53:17Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a07034f2fe3a50622fedc810cf0ac775bbbfe1d3 fix Issue 16747 - Cannot have stack allocated classes in @safe code https://github.com/dlang/dmd/commit/6936a2eca064847160b352ab7f4ab3251acd0d75 Merge pull request #6279 from WalterBright/fix16747
Comment #6 by github-bugzilla — 2016-12-19T16:57:42Z
Commit pushed to scope at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/01170277958c8e1ee67ead8fb112305f0ef220c5 Merge pull request #6279 from WalterBright/fix16747 fix Issue 16747 - Cannot have stack allocated classes in @safe code
Comment #7 by github-bugzilla — 2016-12-27T14:41:36Z
Commits pushed to scope at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a07034f2fe3a50622fedc810cf0ac775bbbfe1d3 fix Issue 16747 - Cannot have stack allocated classes in @safe code https://github.com/dlang/dmd/commit/6936a2eca064847160b352ab7f4ab3251acd0d75 Merge pull request #6279 from WalterBright/fix16747
Comment #8 by github-bugzilla — 2016-12-31T18:15:36Z
Commit pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/01170277958c8e1ee67ead8fb112305f0ef220c5 Merge pull request #6279 from WalterBright/fix16747
Comment #9 by github-bugzilla — 2017-01-16T23:25:43Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a07034f2fe3a50622fedc810cf0ac775bbbfe1d3 fix Issue 16747 - Cannot have stack allocated classes in @safe code https://github.com/dlang/dmd/commit/6936a2eca064847160b352ab7f4ab3251acd0d75 Merge pull request #6279 from WalterBright/fix16747 https://github.com/dlang/dmd/commit/01170277958c8e1ee67ead8fb112305f0ef220c5 Merge pull request #6279 from WalterBright/fix16747
Comment #10 by github-bugzilla — 2017-08-02T08:07:15Z
Commit pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a96b39b3e871b325fa6fb019b74c720303de716f Issue 16747 - Cannot have stack allocated classes in @safe code