www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22399] New: importC: Error: static variable cannot be read at

https://issues.dlang.org/show_bug.cgi?id=22399

          Issue ID: 22399
           Summary: importC: Error: static variable cannot be read at
                    compile time
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

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};
---

--
Oct 17 2021