RE: How to let C++ compiler raise a warning or error when a const is assigned to a const reference?

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

 



Hi Peng,

Please do not cross-post to both gcc-help and gcc.

I believe your code is legal code.

It's not code that does what you want, but it is code that is doing what you told it to do.

Keep in mind, warnings are indicators that the compiler has discovered something suspect -- something that MAY BE an error and is something that people either do often enough (inadvertently) or is generally considered bad programming practice to warrant a warning (perhaps even being a recommended warning by ISO 14882).

My guess is, the situation you cited does not come up often in practice to have caused one of the GCC developers to put a warning into GCC.

HTH,
--Eljay


[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