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

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Tue May 8 14:34:00 GMT 2007



------- 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 undefined
behavior. It's perfectly legal to keep a reference to a temporary, it
may just not yield the result you had hoped for.

W.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=986



More information about the Gcc-bugs mailing list