This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19531] NRV is performed on volatile temporary
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Sep 2007 17:13:02 -0000
- Subject: [Bug c++/19531] NRV is performed on volatile temporary
- References: <bug-19531-9958@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from bangerth at dealii dot org 2007-09-23 17:13 -------
Confirmed indeed. Core DR 20 added the following text to 12.8/15:
This elision of copy operations is permitted in the following
circumstances (which may be combined to eliminate multiple copies):
-- in a return statement in a function with a class return type, when
the expression is the name of a non-volatile automatic object with
the same cv-unqualified type as the function return type, the copy
operation can be omitted by constructing the automatic object
directly into the function's return value
Note that the return expression is specifically restricted to the name of
a *non-volatile automatic object*.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19531