[Bug c++/986] g++ misses warning for on temporary

2010-08-28 Thread redi at gcc dot gnu dot org
--- Comment #29 from redi at gcc dot gnu dot org 2010-08-28 14:39 --- that's why EDG only gives a remark not a warning -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=986

[Bug c++/986] g++ misses warning for on temporary

2010-08-28 Thread redi at gcc dot gnu dot org
--- Comment #30 from redi at gcc dot gnu dot org 2010-08-28 14:42 --- Can we change the summary to mention references? It looks to me as though it's talking about the address-of operator. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=986

[Bug c++/986] g++ misses warning for on temporary

2010-08-27 Thread driscoll at cs dot wisc dot edu
--- Comment #26 from driscoll at cs dot wisc dot edu 2010-08-27 22:02 --- I was surprised to see this is not caught by a warning as well. (The discussion of whether it should be an error is silly; it pretty clearly shouldn't be. There's -Werror if you disagree.) Motivation: This

[Bug c++/986] g++ misses warning for on temporary

2010-08-27 Thread pinskia at gcc dot gnu dot org
--- Comment #27 from pinskia at gcc dot gnu dot org 2010-08-27 22:21 --- This first one is inspired by the code I was working on: Your two functions are well defined as the scope of the temp is only lost after going out of scope. So there is no references to a temp escaping unlike

[Bug c++/986] g++ misses warning for on temporary

2010-08-27 Thread driscoll at cs dot wisc dot edu
--- Comment #28 from driscoll at cs dot wisc dot edu 2010-08-27 22:53 --- Your two functions are well defined as the scope of the temp is only lost after going out of scope. I see A reference is bound to a temporary object: the temporary object is destroyed at the end of the

[Bug c++/986] g++ misses warning for on temporary

2009-08-05 Thread paolo dot carlini at oracle dot com
--- Comment #24 from paolo dot carlini at oracle dot com 2009-08-05 12:34 --- *** Bug 40970 has been marked as a duplicate of this bug. *** -- paolo dot carlini at oracle dot com changed: What|Removed |Added

[Bug c++/986] g++ misses warning for on temporary

2009-08-05 Thread manu at gcc dot gnu dot org
--- Comment #25 from manu at gcc dot gnu dot org 2009-08-05 13:21 --- If anyone has any hint on where this could be caught, suggestions are welcome. The explanation of Alexandre Oliva in comment #8 is totally obscure to me and perhaps outdated given the age of this PR. -- manu at

[Bug c++/986] g++ misses warning for on temporary

2007-05-16 Thread raf2 at msux dot cjb dot net
--- Comment #22 from raf2 at msux dot cjb dot net 2007-05-16 08:50 --- Mmm... maybe I haven't explained correctly. If you contract someone to build stairs and later he says: As long as you don't touch this step, everything's ok you tell him some nasty things. The users of our g++

[Bug c++/986] g++ misses warning for on temporary

2007-05-16 Thread manu at gcc dot gnu dot org
--- Comment #23 from manu at gcc dot gnu dot org 2007-05-16 14:03 --- Hi Naimu, I am not speaking in the name of the GCC community but I would like to prevent your frustration. You exposed your point clearly. People that have a deep knowledge of C++ and g++ don't agree with you.

[Bug c++/986] g++ misses warning for on temporary

2007-05-14 Thread raf2 at msux dot cjb dot net
--- Comment #20 from raf2 at msux dot cjb dot net 2007-05-14 09:30 --- We have talked about the undefined behaviour of having references to objects that have been destroyed. Can someone provide a program with that undefined behaviour that could not be considered an error? --

[Bug c++/986] g++ misses warning for on temporary

2007-05-14 Thread bangerth at dealii dot org
--- Comment #21 from bangerth at dealii dot org 2007-05-14 17:50 --- This is getting completely off-topic, so here's my last post: (In reply to comment #20) Can someone provide a program with that undefined behaviour that could not be considered an error? As long as you don't touch

[Bug c++/986] g++ misses warning for on temporary

2007-05-09 Thread raf2 at msux dot cjb dot net
--- 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

[Bug c++/986] g++ misses warning for on temporary

2007-05-09 Thread bangerth at dealii dot org
--- Comment #18 from bangerth at dealii dot org 2007-05-09 16:39 --- (In reply to comment #17) 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

[Bug c++/986] g++ misses warning for on temporary

2007-05-09 Thread chris at bubblescope dot net
--- Comment #19 from chris at bubblescope dot net 2007-05-09 17:05 --- while I agree we shouldn't produce an error here, personally I'm highly unconvinced by your argument. If I had some code which if called would always lead to undefined behaviour, but never called it, I would still

[Bug c++/986] g++ misses warning for on temporary

2007-05-08 Thread bangerth at dealii dot org
--- Comment #13 from bangerth at dealii dot org 2007-05-08 15:34 --- (In reply to comment #12) The summary says g++ misses warning for on temporary. But something that is always an error can be called a warning? The point is that the standard doesn't call it an error, but

[Bug c++/986] g++ misses warning for on temporary

2007-05-08 Thread raf2 at msux dot cjb dot net
--- Comment #14 from raf2 at msux dot cjb dot net 2007-05-08 17:18 --- I first was hit by an error using MinGW... when I compiled and executed the first attached file, it wrote: John drives a: bus Otto drives a: bus Which was wrong, I reported the bug and a guy from

[Bug c++/986] g++ misses warning for on temporary

2007-05-08 Thread raf2 at msux dot cjb dot net
--- Comment #15 from raf2 at msux dot cjb dot net 2007-05-08 17:22 --- Created an attachment (id=13531) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13531action=view) File with wrong code that leads to an unexpected result -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=986

[Bug c++/986] g++ misses warning for on temporary

2007-05-08 Thread bangerth at dealii dot org
--- Comment #16 from bangerth at dealii dot org 2007-05-08 17:25 --- (In reply to comment #14) Which was wrong, I reported the bug and a guy from MinGW kindly explained that if it worked then that would be purely by accident and added: When you declare the argument without '' then

[Bug c++/986] g++ misses warning for on temporary

2007-05-02 Thread bangerth at dealii dot org
--- Comment #10 from bangerth at dealii dot org 2007-05-02 22:56 --- *** Bug 31788 has been marked as a duplicate of this bug. *** -- bangerth at dealii dot org changed: What|Removed |Added

[Bug c++/986] g++ misses warning for on temporary

2006-10-26 Thread bangerth at dealii dot org
--- Comment #9 from bangerth at dealii dot org 2006-10-26 06:35 --- *** Bug 29593 has been marked as a duplicate of this bug. *** -- bangerth at dealii dot org changed: What|Removed |Added

[Bug c++/986] g++ misses warning for on temporary

2005-02-16 Thread aoliva at gcc dot gnu dot org
--- Additional Comments From aoliva at gcc dot gnu dot org 2005-02-16 17:27 --- Getting a warning to be issued is easy: initialize_ref may print it if it finds that the call to convert_like will create a temporary, testing conv-need_temporary_p. However, this would trigger warnings for