https://issues.dlang.org/show_bug.cgi?id=22513
Issue ID: 22513
Summary: ImportC: address of member of struct can’t be taken at
compile time.
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
The following valid C code fails to compile:
// staticvar.c
int x = 0;
int* y = &x; // ok
struct Foo {
int x;
};
struct Foo f = {3};
int* z = &f.x; // error
The message is:
staticvar.c(10): Error: static variable `f` cannot be read at compile time
--