Reference declaration with self-assignment. Is it legal? G++ says it is!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello to all!

I would like to make a quick question.

G++ seems to allow this:

int& x = x;

which creates a null int reference. Why does G++ allows this? Is it a
standard thing? This doesn't even generates a warning, and such code can
easily cause a segfault.

Thanks for the info
Carlos Miguel Ferreira




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux