------- 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

Reply via email to