https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108842
Bug ID: 108842
Summary: Cannot use enum array with -fno-druntime
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: d
Assignee: ibuclaw at gdcproject dot org
Reporter: zach-gcc at cs dot stanford.edu
Target Milestone: ---
I have test.d:
```
enum int[] x = [0, 1, 2];
```
and an object.d:
```
module object;
```
I get an error when I try to compile:
```
$ gdc -c -fno-druntime test.d
test.d:1:16: error: expression '[0, 1, 2]' requires 'object.TypeInfo' and
cannot be used with '-fno-rtti'
1 | enum int[] x = [0, 1, 2];
| ^
test.d:1:16: error: 'object.TypeInfo' could not be found, but is implicitly
used
1 | enum int[] x = [0, 1, 2];
| ^
```
This compiles fine with DMD and LDC with `-betterC` and the same object.d
(custom runtime).