Bug 14252 – Erroneous dtor attributes check even if the struct returned immediately

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-03-07T02:51:26Z
Last change time
2024-12-13T18:40:54Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Kenji Hara
Moved to GitHub: dmd#18951 →

Comments

Comment #0 by k.hara.pg — 2015-03-07T02:51:26Z
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'
Comment #1 by robert.schadek — 2024-12-13T18:40:54Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18951 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB