public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19531] New: RVO is performed on volatile temporary
@ 2005-01-19 15:31 christian dot bruel at st dot com
  2005-01-19 15:38 ` [Bug c++/19531] NRV " pinskia at gcc dot gnu dot org
  2005-03-05 23:29 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 9+ messages in thread
From: christian dot bruel at st dot com @ 2005-01-19 15:31 UTC (permalink / raw)
  To: gcc-bugs

RVO is performed on a temporary object that is declared volatile.
That seems contradictory with the ISO standards 12.8 15 (object and copy must
have the same cv-unqualified type).

With the following piece of code, I was excepting the copy constructor and
destructor to be called.

struct String
{
  int field;

  String();
  String(int);
  ~String();
  String (const String &);
  String (volatile const String &);
};

String name()
{
  volatile String t(777);
  return t;
}

checking !TREE_VOLATILE (r) in finish_function where the named return value
optimization is set up fixes the problem.

-- 
           Summary: RVO is performed on volatile temporary
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: christian dot bruel at st dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-10-31  8:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-19531-9958@http.gcc.gnu.org/bugzilla/>
2007-09-23 12:26 ` [Bug c++/19531] NRV is performed on volatile temporary rguenth at gcc dot gnu dot org
2007-09-23 17:13 ` bangerth at dealii dot org
2007-09-24  7:10 ` chrbr at gcc dot gnu dot org
2007-09-24  7:15 ` chrbr at gcc dot gnu dot org
2007-10-08 11:03 ` chrbr at gcc dot gnu dot org
2007-10-31  7:56 ` chrbr at gcc dot gnu dot org
2007-10-31  8:01 ` chrbr at gcc dot gnu dot org
2005-01-19 15:31 [Bug c++/19531] New: RVO " christian dot bruel at st dot com
2005-01-19 15:38 ` [Bug c++/19531] NRV " pinskia at gcc dot gnu dot org
2005-03-05 23:29 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).