digitalmars.D.bugs - [Issue 14252] New: Erroneous dtor attributes check even if the
- via Digitalmars-d-bugs (32/32) Mar 06 2015 https://issues.dlang.org/show_bug.cgi?id=14252
https://issues.dlang.org/show_bug.cgi?id=14252 Issue ID: 14252 Summary: Erroneous dtor attributes check even if the struct returned immediately Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: k.hara.pg gmail.com Following code should work, but doesn't. struct Variant { this(int) pure {} ~this() {} // impure } auto makeVar(int n) pure { return Variant(1); // line 9 } void main() { auto v = makeVar(1); } test.d(9): Error: pure function 'test.makeVar' cannot call impure function 'test.Variant.~this' --
Mar 06 2015