Bug 9899 – struct with pure/nothrow destructor cannot be used as a struct member in pure/nothrow functions

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-04-07T10:31:00Z
Last change time
2013-04-10T23:47:00Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
henning

Comments

Comment #0 by henning — 2013-04-07T10:31:36Z
struct S { nothrow pure ~this() { } } struct MemberS { S s; } void main() nothrow pure { // 10 MemberS s; // 11 } ----- main.d(11): Error: pure function 'D main' cannot call impure function 'main.MemberS.~this' main.d(11): Error: s.~this is not nothrow main.d(10): Error: function D main 'main' is nothrow yet may throw ----- Note: When the destructor is removed, everything works just fine.
Comment #1 by k.hara.pg — 2013-04-07T21:27:51Z
Comment #2 by github-bugzilla — 2013-04-10T23:46:48Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a886e55abe29ed1ffe05ba154e2977443ad808ec fix Issue 9899 - struct with pure/nothrow destructor cannot be used as a struct member in pure/nothrow functions https://github.com/D-Programming-Language/dmd/commit/5a0d812059995186860a418735c77e432b05500e Merge pull request #1866 from 9rnsr/fix9899 Issue 9899 - struct with pure/nothrow destructor cannot be used as a struct member in pure/nothrow functions