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++/19317] [4.0 Regression] removing a temporary return value when we cannot


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-10 04:52 -------
Yes this is defind. As 12.2P1 says:
"Temporaries of class types are created in various contexts: ... returning an rvalue (6.6.3) ..."
"Even when the creation of the temporary object is avoided (12.8), all semantic restrictions must be 
respected as if the temporary object was created".

So we have to create a temporary variable for this return value in all three of my examples.  Hmm, the c 
example for all three does the correct thing and create a temporary variable.

-- 


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


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