www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Static struct assign

DMD 1.026 used by Codepad used to give errors on this code:
http://codepad.org/QSE36vhJ

struct S { int x; }
void main() {
    S i = 5;
    printf("%d", i.x); // prints 0
}

But the current DMD/LDC give no compilation error and just print "0".
Is this a new bug in the front-end?

Bye,
bearophile
May 28 2009