www.digitalmars.com         C & C++   DMDScript  

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

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

          Issue ID: 22972
           Summary: importC: static variable cannot be read 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 puremagic.com
          Reporter: duser neet.fi
                CC: duser neet.fi

struct op {
        char text[4];
};
struct op ops[] = {
        { "123" }
};
char *x[] = { ops[0].text };

Error: static variable `ops` cannot be read at compile time

--
Apr 02 2022