[Issue 20715] New: `Error: TypeInfo cannot be used with -betterC` for array of struct = void with copy constructor disabled

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 1 00:23:33 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20715

          Issue ID: 20715
           Summary: `Error: TypeInfo cannot be used with -betterC` for
                    array of struct = void with copy constructor disabled
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: andy.pj.hanson at gmail.com

```
extern(C) void main() {
        A a;
}

struct A {
        B[4] data = void;
}

struct B {
        @disable this(ref B b);
        ~this() {}
}
```

Compile with `dmd -betterC app.d`. Testing with dmd v2.091.0.
This code fails with:
```
Error: TypeInfo cannot be used with -betterC
```

There is no error location either!

--


More information about the Digitalmars-d-bugs mailing list