Bug 23058 – importC: cannot take address inside multi-dimensional array at compile time
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-24T23:36:11Z
Last change time
2022-05-12T06:41:27Z
Keywords
ImportC, pull, rejects-valid
Assigned to
No Owner
Creator
duser
Comments
Comment #0 by duser — 2022-04-24T23:36:11Z
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"
Comment #1 by dlang-bot — 2022-04-30T00:17:28Z
@WalterBright created dlang/dmd pull request #14044 "fix Issue 23058 - importC: cannot take address inside multi-dimension…" fixing this issue:
- fix Issue 23058 - importC: cannot take address inside multi-dimensional array at compile time
https://github.com/dlang/dmd/pull/14044
Comment #2 by dlang-bot — 2022-05-09T01:16:35Z
@WalterBright created dlang/dmd pull request #14094 "reboot fix Issue 23058 - importC: cannot take address inside multi-di…" mentioning this issue:
- reboot fix Issue 23058 - importC: cannot take address inside multi-dimensional array at compile time
https://github.com/dlang/dmd/pull/14094
Comment #3 by dlang-bot — 2022-05-11T22:06:22Z
dlang/dmd pull request #14094 "reboot fix Issue 23058 - importC: cannot take address inside multi-di…" was merged into master:
- 83c88962ff673d1eedfe1bffff57b048927e007b by Walter Bright:
reboot fix Issue 23058 - importC: cannot take address inside multi-dimensional array at compile time
https://github.com/dlang/dmd/pull/14094