Bug 23027 – ImportC: Array of struct is not a static and cannot have static initializer
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-17T06:28:32Z
Last change time
2022-09-16T08:48:22Z
Keywords
ImportC, rejects-valid
Assigned to
No Owner
Creator
dave287091
Comments
Comment #0 by dave287091 — 2022-04-17T06:28:32Z
The following C code fails to compile:
struct S {
int x;
};
int main(){
struct S s[8] = {0}; // Error: variable `test.main.s` is not a static and cannot have static initializer
return 0;
}
Comment #1 by dlang-bot — 2022-09-16T08:48:22Z
dlang/dmd pull request #14443 "fix Issue 23027 - ImportC: Array of struct is not a static and cannot…" was merged into master:
- bb9d1f831b7e2ebdd74881303082b770b74d0f10 by Walter Bright:
fix Issue 23027 - ImportC: Array of struct is not a static and cannot have static initializer
https://github.com/dlang/dmd/pull/14443