Bug 10053 – struct member with pure dtor forces declared dtor to be pure, too

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-09T14:45:00Z
Last change time
2013-05-10T12:29:55Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
henning

Comments

Comment #0 by henning — 2013-05-09T14:45:15Z
struct S1 { ~this() pure { } } struct S2 { S1 s; ~this() { } } void main() { } 2.063a: ----- Error: pure function 'main.S2.~this' cannot call impure function 'main.S2.~this' -----
Comment #1 by henning — 2013-05-09T15:01:45Z
Comment #2 by k.hara.pg — 2013-05-09T23:58:04Z
Is this really a regression? The OP code didn't compile with 2.062 and earlier.
Comment #3 by k.hara.pg — 2013-05-10T00:29:11Z
(In reply to comment #2) > Is this really a regression? The OP code didn't compile with 2.062 and earlier. OK, I confirmed. Instead of the OP code, this code: struct S1 { pure ~this() { } } struct S2 { S1 s; ~this() { } } compiles with 2.062 but fails with git head(1290d1b).
Comment #4 by github-bugzilla — 2013-05-10T00:53:34Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/340e39ca62067597e119b786dc87364a988ca292 fix issue 10053 - struct member with pure dtor forces declared dtor to be pure, too https://github.com/D-Programming-Language/dmd/commit/c7f2b375dc17819f69a334f00b6ede2345588798 Merge pull request #1999 from hpohl/10053 [REG2.063a] Issue 10053 - struct member with pure dtor forces declared dtor to be pure, too
Comment #5 by github-bugzilla — 2013-05-10T12:29:55Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/65dfa73ebe20e8bfc10f328ccac8ff44653ea771 Move test case for issue 10053 to runnable/sdtor.d Collecting tests for struct destructor into same file is useful.