[Issue 19676] New: Destructor not called for returned temporary that was cast to void
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Feb 15 07:47:37 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=19676
Issue ID: 19676
Summary: Destructor not called for returned temporary that was
cast to void
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: bugzilla at digitalmars.com
struct S {
~this();
}
S foo();
void test1() {
foo(); // Correct: destructor called
}
void test2() {
cast(void)foo(); // Bug: destructor not called
}
--
More information about the Digitalmars-d-bugs
mailing list