November 14, 2021 [Issue 22513] New: ImportC: address of member of struct can’t be taken at compile time. | ||||
|---|---|---|---|---|
| ||||
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: nobody@puremagic.com Reporter: dave287091@gmail.com 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 -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply