www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22336] New: core.lifetime.move doesn't work with betterC on


          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:

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);

Ends up with:
Error: `TypeInfo` cannot be used with -betterC

That leads here:

Sep 25 2021