Bug 22399 – importC: Error: static variable cannot be read at compile time

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-10-17T13:12:50Z
Last change time
2021-10-21T21:39:31Z
Keywords
ImportC, rejects-valid
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2021-10-17T13:12:50Z
GCC compiles this without problems. --- struct S1 { unsigned short f1; }; struct S2 { const struct S1 *f1; }; const struct S1 C1[1] = { {12} }; const struct S2 C3 = {C1}; ---
Comment #1 by ibuclaw — 2021-10-17T23:36:59Z
*** This issue has been marked as a duplicate of issue 22407 ***
Comment #2 by dlang-bot — 2021-10-18T07:51:07Z
dlang/dmd pull request #13182 "fix Issue 22407 - importC: Error: cannot implicitly convert expression of type 'extern (C) int(int a)' to 'const(extern (C) int function(int))'" was merged into stable: - 16565e5d4714b8412f247c2debf209c6d6b1a71d by Iain Buclaw: fix Issue 22399 - importC: Error: static variable cannot be read at compile time https://github.com/dlang/dmd/pull/13182
Comment #3 by dlang-bot — 2021-10-21T21:39:31Z
dlang/dmd pull request #13209 "Merge stable into master" was merged into master: - 58e4db98807ba9834f79ca4585afb103e7da0b38 by Iain Buclaw: fix Issue 22399 - importC: Error: static variable cannot be read at compile time https://github.com/dlang/dmd/pull/13209