public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/53202] New: Copy constructor not called when starting a thread
@ 2012-05-02 21:14 anthony.ajw at gmail dot com
  2012-05-02 21:25 ` [Bug libstdc++/53202] " redi at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: anthony.ajw at gmail dot com @ 2012-05-02 21:14 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53202
           Summary: Copy constructor not called when starting a thread
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: anthony.ajw@gmail.com


Created attachment 27291
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27291
Simple test program

When compiling and running the attached program the copy constructor for
background_hello should be called at least once. It is not being called at all,
but the function call operator is showing a different this pointer, and the
destructor is called 3 times.

~$ g++ --version
g++ (Ubuntu/Linaro 4.7.0-7ubuntu1) 4.7.0
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

~$ g++ -std=c++0x -pthread t.cpp && ./a.out
default ctor called, this=0x7fffc2b05bdf
destructor called, this=0x7fffc2b05b8f
void background_hello::operator()() called, this=0x922040
destructor called, this=0x922040
destructor called, this=0x7fffc2b05bdf


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

end of thread, other threads:[~2012-06-25 15:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-02 21:14 [Bug libstdc++/53202] New: Copy constructor not called when starting a thread anthony.ajw at gmail dot com
2012-05-02 21:25 ` [Bug libstdc++/53202] " redi at gcc dot gnu.org
2012-05-03  0:45 ` [Bug c++/53202] " redi at gcc dot gnu.org
2012-05-03  1:14 ` redi at gcc dot gnu.org
2012-05-03  8:23 ` redi at gcc dot gnu.org
2012-05-03  8:31 ` redi at gcc dot gnu.org
2012-06-15  0:41 ` [Bug c++/53202] [4.7/4.8 Regression] " redi at gcc dot gnu.org
2012-06-15  3:04 ` hjl.tools at gmail dot com
2012-06-22  9:16 ` jason at gcc dot gnu.org
2012-06-25 15:18 ` jason at gcc dot gnu.org
2012-06-25 15:41 ` jason at gcc dot gnu.org
2012-06-25 15:45 ` jason at gcc dot gnu.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).