g++ allows to exist not inited reference in this case: struct X { int &x; }; int main() { X* p_x = new X; // now there is not inited reference (p_x->x) // now we can try to use p_x->x std::cout << p_x->x << std::endl; // segmentation fault return 0; } There are no errors or warnings. Compilation is successfull. I have tested on g++ (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3). Also it "works" on g++ 4.3.
Confirmed.
I think it should be error, not warning. (comeau and ms vc claims it as error)
This is looks like PR 29039.
*** Bug 39963 has been marked as a duplicate of this bug. ***
Fixed in 4.6.x.