Comment #0 by andrej.mitrovich — 2011-09-21T20:50:04Z
struct Foo
{
static assert(Foo.sizeof == 4); // ok
pragma(msg, Foo.sizeof); // Error: struct test.Foo no size yet for forward reference
int x;
}
void main() { }
I'm not sure if it's genuinely a bug, IOW maybe the pragma is evaluated before the compiler does a pass to see which fields the struct is holding?
Comment #1 by andrej.mitrovich — 2012-01-04T06:56:49Z
Workaround: Put the pragma call outside of the structure definition.
Comment #2 by andrej.mitrovich — 2012-04-19T18:48:26Z
Fixed in 2.059, don't know by which commit though.