digitalmars.D.bugs - [Issue 22336] New: core.lifetime.move doesn't work with betterC on
- d-bugmail puremagic.com (38/38) Sep 25 2021 https://issues.dlang.org/show_bug.cgi?id=22336
https://issues.dlang.org/show_bug.cgi?id=22336 Issue ID: 22336 Summary: core.lifetime.move doesn't work with betterC on elaborate non zero structs Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: druntime Assignee: nobody puremagic.com Reporter: chalucha gmail.com Test case fails with betterC: ```D import core.lifetime; import core.stdc.stdio; struct Foo { int f = -1; // works if left to init value disable this(this); } extern(C) void main() { Foo a = Foo(42); Foo b = move(a); assert(a.f == -1); assert(b.f == 42); printf("ok\n"); } ``` Ends up with: ``` /home/tomas/dlang/dmd-2.097.2/linux/bin64/../../src/druntime/import/core/lifetime.d(2126,29): Error: `TypeInfo` cannot be used with -betterC ``` That leads here: https://github.com/dlang/druntime/blob/f978df34a48613492240e8398227419b14002bef/src/core/lifetime.d#L2126 --
Sep 25 2021