www.digitalmars.com         C & C++   DMDScript  

c++ - crash: uninitialized reference

Due to a missing error message, this compiles and crashes:

struct X {
// X() {} // uncomment to get the error msg.
 int& x;
};

int main()
{
 X bad;
 bad.x = 0;
}

Cheers,
Sz.
Nov 04 2003