[Issue 21622] New: pragma(crt_constructor) accepts functions that return non-POD types
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Feb 9 08:19:56 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=21622
Issue ID: 21622
Summary: pragma(crt_constructor) accepts functions that return
non-POD types
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: bugzilla at digitalmars.com
Returning types with destructors or that require hidden pointers to the return
type is obviously going to fail, but is accepted by the compiler.
struct S { ~this(); }
extern (C)
pragma(crt_constructor) S foo() { return S(); } // should not compile
--
More information about the Digitalmars-d-bugs
mailing list