This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


------- Additional Comments From joerg dot richter at pdv-fs dot de  2004-06-16 08:31 -------
The lifetime of the temporary is not expanded to Y's lifetime.

12.2/5

"A temporary bound to a reference member in a constructor's ctor-initializer 
persists until the constructor exits."

So acually there is a dangling reference after the constructor was called. 
I think a warning in this place would be fine.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]