[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

[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.) Motiva