[Issue 23058] New: importC: can't take address inside multi-dimensional array at compile time
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Apr 24 23:36:11 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23058
Issue ID: 23058
Summary: importC: can't take address inside multi-dimensional
array at compile time
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: ImportC, rejects-valid
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: duser at neet.fi
CC: duser at neet.fi
int arr2[1][1] = {{0}};
int *p1 = &arr2[0][0];
int arr3[1][1][1] = {{{0}}};
int **p2 = &arr3[0][0];
int *p3 = arr3[0][0];
int *p4 = &arr3[0][0][0];
test.c(2): Error: static variable `arr2` cannot be read at compile time
test.c(5): Error: static variable `arr3` cannot be read at compile time
test.c(6): Error: static variable `arr3` cannot be read at compile time
test.c(7): Error: static variable `arr3` cannot be read at compile time
if the arrays are made const, all the accesses give "Error: unknown, please
file report on issues.dlang.org"
--
More information about the Digitalmars-d-bugs
mailing list