This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53202] Copy constructor not called when starting a thread
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 May 2012 08:22:51 +0000
- Subject: [Bug c++/53202] Copy constructor not called when starting a thread
- Auto-submitted: auto-generated
- References: <bug-53202-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53202
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-03 08:22:51 UTC ---
Created attachment 27301
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27301
preprocessed source
This preprocessed source was created by G++ version 4.6.3 20120306 (Red Hat
4.6.3-2)
When compiled with 4.6.3 it gives:
default ctor called, this=0x7fffba05109f
copy ctor called, this=0x7fffba051067
move ctor called, this=0x253d010
destructor called, this=0x7fffba051067
void background_hello::operator()() called, this=0x253d010
destructor called, this=0x253d010
destructor called, this=0x7fffba05109f
When the same preprocessed source is compiled with the 4.7 branch or trunk it
gives:
default ctor called, this=0x7fff8a2f7daf
move ctor called, this=0x1d56010
destructor called, this=0x7fff8a2f7d77
void background_hello::operator()() called, this=0x1d56010
destructor called, this=0x1d56010
destructor called, this=0x7fff8a2f7daf
N.B. there is only one missing constructor here, compared to two when the
original source is compiled with trunk, I guess that's due to a change in
<tuple> between 4.6 and 4.8, but the same preprocessed input should still
produce the same result with both versions, so I think that rules out library
changes being the sole cause of this bug