This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/986] g++ misses warning for & on temporary
- From: "raf2 at msux dot cjb dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 May 2007 15:27:16 -0000
- Subject: [Bug c++/986] g++ misses warning for & on temporary
- References: <bug-986-184@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #17 from raf2 at msux dot cjb dot net 2007-05-09 16:27 -------
> Compilers may warn about this, but they may not issue an error.
Let's see what has to say the freely available Borland C++ 5.5.1 for Windows.
Yes, it wisely stops people from compiling the attached "main.cpp":
Error E2359 main.cpp 23: Reference member 'Driver::what_drives' initialized
with a non-reference parameter in function Driver::Driver(Automobile)
Are comitee decisions (right or wrong) more important than consequences for
people? So Borland protects people from undefined behaviours when they can, and
I wonder, isn't what most people need? isn't what most people want?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=986