https://issues.dlang.org/show_bug.cgi?id=19244
Issue ID: 19244 Summary: betterC function return struct calling dtor (or not calling postblit) Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: patric.dexhei...@gmail.com //flags: -betterC import core.stdc.stdio; struct T { this() { printf("postblit\n") } //not called ~this() { printf("dtor\n"); } //called twice } auto build() { T t; return t; } extern(C): void main() { auto x = build; } //output: //dtor //dtor //without -betterC dtor is called once; --