[thread] Compiler eoorrs while running the tests

Hi, I get some compile errors with boost 1.43 gcc.compile.c++ ..\..\..\bin.v2\libs\thread\test\test_thread_return_local_lib.test\gcc-mingw-4.4.0\debug\threading-multi\test_thread_return_local.o ..\..\../boost/thread/detail/thread.hpp: In function 'boost::thread make_thread_return_local(boost::thread::id*)': ..\..\../boost/thread/detail/thread.hpp:111: error: 'boost::thread::thread(boost::thread&)' is private test_thread_return_local.cpp:16: error: within this context How can the following compile? boost::thread make_thread_return_local(boost::thread::id* the_id) { boost::thread t(do_nothing,the_id); return t; } Best, _____________________ Vicente Juan Botet Escribá http://viboes.blogspot.com/

"vicente.botet" <vicente.botet@wanadoo.fr> writes:
Hi,
I get some compile errors with boost 1.43
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\test\test_thread_return_local_lib.test\gcc-mingw-4.4.0\debug\threading-multi\test_thread_return_local.o ..\..\../boost/thread/detail/thread.hpp: In function 'boost::thread make_thread_return_local(boost::thread::id*)': ..\..\../boost/thread/detail/thread.hpp:111: error: 'boost::thread::thread(boost::thread&)' is private test_thread_return_local.cpp:16: error: within this context
How can the following compile?
boost::thread make_thread_return_local(boost::thread::id* the_id) { boost::thread t(do_nothing,the_id); return t; }
It works on compilers with rvalue references, and on MSVC. With g++ it should work if you specify -std=c++0x. Anthony -- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com> To: <boost@lists.boost.org> Sent: Thursday, May 20, 2010 1:21 PM Subject: Re: [boost] [thread] Compiler eoorrs while running the tests
"vicente.botet" <vicente.botet@wanadoo.fr> writes:
Hi,
I get some compile errors with boost 1.43
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\test\test_thread_return_local_lib.test\gcc-mingw-4.4.0\debug\threading-multi\test_thread_return_local.o ..\..\../boost/thread/detail/thread.hpp: In function 'boost::thread make_thread_return_local(boost::thread::id*)': ..\..\../boost/thread/detail/thread.hpp:111: error: 'boost::thread::thread(boost::thread&)' is private test_thread_return_local.cpp:16: error: within this context
How can the following compile?
boost::thread make_thread_return_local(boost::thread::id* the_id) { boost::thread t(do_nothing,the_id); return t; }
It works on compilers with rvalue references, and on MSVC. With g++ it should work if you specify -std=c++0x.
It would be possible to run these tests only with compilers having rvalue references. Best, Vicente

"vicente.botet" <vicente.botet@wanadoo.fr> writes:
----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com> To: <boost@lists.boost.org> Sent: Thursday, May 20, 2010 1:21 PM Subject: Re: [boost] [thread] Compiler eoorrs while running the tests
"vicente.botet" <vicente.botet@wanadoo.fr> writes:
Hi,
I get some compile errors with boost 1.43
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\test\test_thread_return_local_lib.test\gcc-mingw-4.4.0\debug\threading-multi\test_thread_return_local.o ..\..\../boost/thread/detail/thread.hpp: In function 'boost::thread make_thread_return_local(boost::thread::id*)': ..\..\../boost/thread/detail/thread.hpp:111: error: 'boost::thread::thread(boost::thread&)' is private test_thread_return_local.cpp:16: error: within this context
How can the following compile?
boost::thread make_thread_return_local(boost::thread::id* the_id) { boost::thread t(do_nothing,the_id); return t; }
It works on compilers with rvalue references, and on MSVC. With g++ it should work if you specify -std=c++0x.
It would be possible to run these tests only with compilers having rvalue references.
It's marked as an expected failure on most platforms. The fact that it fails serves as documentation that it's not supported. I'm not sure whether classes using Boost.Move support this. Anthony -- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com> To: <boost@lists.boost.org> Sent: Thursday, May 20, 2010 5:08 PM Subject: Re: [boost] [thread] Compiler eoorrs while running the tests
"vicente.botet" <vicente.botet@wanadoo.fr> writes:
----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com> To: <boost@lists.boost.org> Sent: Thursday, May 20, 2010 1:21 PM Subject: Re: [boost] [thread] Compiler eoorrs while running the tests
"vicente.botet" <vicente.botet@wanadoo.fr> writes:
Hi,
I get some compile errors with boost 1.43
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\test\test_thread_return_local_lib.test\gcc-mingw-4.4.0\debug\threading-multi\test_thread_return_local.o ..\..\../boost/thread/detail/thread.hpp: In function 'boost::thread make_thread_return_local(boost::thread::id*)': ..\..\../boost/thread/detail/thread.hpp:111: error: 'boost::thread::thread(boost::thread&)' is private test_thread_return_local.cpp:16: error: within this context
How can the following compile?
boost::thread make_thread_return_local(boost::thread::id* the_id) { boost::thread t(do_nothing,the_id); return t; }
It works on compilers with rvalue references, and on MSVC. With g++ it should work if you specify -std=c++0x.
It would be possible to run these tests only with compilers having rvalue references.
It's marked as an expected failure on most platforms. The fact that it fails serves as documentation that it's not supported. I'm not sure whether classes using Boost.Move support this.
Could you give a platform on which this works (of course other that C++0x support)? I don't see the advantage of marking it as expected failure if there is no one that succeed. It would be better document that this is not supported on the documentation. Best, Vicente

"vicente.botet" <vicente.botet@wanadoo.fr> writes:
----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com> To: <boost@lists.boost.org> Sent: Thursday, May 20, 2010 5:08 PM Subject: Re: [boost] [thread] Compiler eoorrs while running the tests
"vicente.botet" <vicente.botet@wanadoo.fr> writes:
----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com> To: <boost@lists.boost.org> Sent: Thursday, May 20, 2010 1:21 PM Subject: Re: [boost] [thread] Compiler eoorrs while running the tests
"vicente.botet" <vicente.botet@wanadoo.fr> writes:
Hi,
I get some compile errors with boost 1.43
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\test\test_thread_return_local_lib.test\gcc-mingw-4.4.0\debug\threading-multi\test_thread_return_local.o ..\..\../boost/thread/detail/thread.hpp: In function 'boost::thread make_thread_return_local(boost::thread::id*)': ..\..\../boost/thread/detail/thread.hpp:111: error: 'boost::thread::thread(boost::thread&)' is private test_thread_return_local.cpp:16: error: within this context
How can the following compile?
boost::thread make_thread_return_local(boost::thread::id* the_id) { boost::thread t(do_nothing,the_id); return t; }
It works on compilers with rvalue references, and on MSVC. With g++ it should work if you specify -std=c++0x.
It would be possible to run these tests only with compilers having rvalue references.
It's marked as an expected failure on most platforms. The fact that it fails serves as documentation that it's not supported. I'm not sure whether classes using Boost.Move support this.
Could you give a platform on which this works (of course other that C++0x support)? I don't see the advantage of marking it as expected failure if there is no one that succeed. It would be better document that this is not supported on the documentation.
According to the test results on trunk, it passes on Intel 10.1/Darwin, vacpp/AIX and gcc 4.3.4/FreeBSD, as well as the various gcc -std=c++0x test runners. I thought it also passed on MSVC 9, but it appears I was mistaken. Anthony -- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com> To: <boost@lists.boost.org> Sent: Friday, May 21, 2010 8:42 AM Subject: Re: [boost] [thread] Compiler eoorrs while running the tests
"vicente.botet" <vicente.botet@wanadoo.fr> writes:
----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com> To: <boost@lists.boost.org> Sent: Thursday, May 20, 2010 5:08 PM Subject: Re: [boost] [thread] Compiler eoorrs while running the tests
"vicente.botet" <vicente.botet@wanadoo.fr> writes:
----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com> To: <boost@lists.boost.org> Sent: Thursday, May 20, 2010 1:21 PM Subject: Re: [boost] [thread] Compiler eoorrs while running the tests
"vicente.botet" <vicente.botet@wanadoo.fr> writes:
Hi,
I get some compile errors with boost 1.43
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\test\test_thread_return_local_lib.test\gcc-mingw-4.4.0\debug\threading-multi\test_thread_return_local.o ..\..\../boost/thread/detail/thread.hpp: In function 'boost::thread make_thread_return_local(boost::thread::id*)': ..\..\../boost/thread/detail/thread.hpp:111: error: 'boost::thread::thread(boost::thread&)' is private test_thread_return_local.cpp:16: error: within this context
How can the following compile?
boost::thread make_thread_return_local(boost::thread::id* the_id) { boost::thread t(do_nothing,the_id); return t; }
It works on compilers with rvalue references, and on MSVC. With g++ it should work if you specify -std=c++0x.
It would be possible to run these tests only with compilers having rvalue references.
It's marked as an expected failure on most platforms. The fact that it fails serves as documentation that it's not supported. I'm not sure whether classes using Boost.Move support this.
Could you give a platform on which this works (of course other that C++0x support)? I don't see the advantage of marking it as expected failure if there is no one that succeed. It would be better document that this is not supported on the documentation.
According to the test results on trunk, it passes on Intel 10.1/Darwin, vacpp/AIX and gcc 4.3.4/FreeBSD, as well as the various gcc -std=c++0x test runners. I thought it also passed on MSVC 9, but it appears I was mistaken.
Have 10.1/Darwin, vacpp/AIX and gcc 4.3.4/FreeBSD rvalue references when running on C++098 mode? I don't undesrtand how this test can work with your move semantics emulation? boost::thread make_thread_return_local(boost::thread::id* the_id) { boost::thread t(do_nothing,the_id); return t; } Best, Vicente

"vicente.botet" <vicente.botet@wanadoo.fr> writes:
----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com>
Have 10.1/Darwin, vacpp/AIX and gcc 4.3.4/FreeBSD rvalue references when running on C++098 mode?
I don't know about Intel 10.1 or vacpp, but gcc 4.3.4 only has rvalue references in C++0x mode.
I don't undesrtand how this test can work with your move semantics emulation?
boost::thread make_thread_return_local(boost::thread::id* the_id) { boost::thread t(do_nothing,the_id); return t; }
It's the NRVO optimization --- the named object is constructed directly in the return value rather than copied. Many compilers do the optimization, but they are supposed to check for an accessible copy constructor anyway. The compilers it works on must skip the required check for an accessible copy constructor, so they are not strictly conforming to C++98, but in this case it's a bonus. In C++0x this is also required to work if the object being returned has an accessible move constructor. Anthony -- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com> To: <boost@lists.boost.org> Sent: Friday, May 21, 2010 10:01 AM Subject: Re: [boost] [thread] Compiler eoorrs while running the tests
"vicente.botet" <vicente.botet@wanadoo.fr> writes:
----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com>
Have 10.1/Darwin, vacpp/AIX and gcc 4.3.4/FreeBSD rvalue references when running on C++098 mode?
I don't know about Intel 10.1 or vacpp, but gcc 4.3.4 only has rvalue references in C++0x mode.
I don't undesrtand how this test can work with your move semantics emulation?
boost::thread make_thread_return_local(boost::thread::id* the_id) { boost::thread t(do_nothing,the_id); return t; }
It's the NRVO optimization --- the named object is constructed directly in the return value rather than copied. Many compilers do the optimization, but they are supposed to check for an accessible copy constructor anyway.
The compilers it works on must skip the required check for an accessible copy constructor, so they are not strictly conforming to C++98, but in this case it's a bonus. In C++0x this is also required to work if the object being returned has an accessible move constructor.
Well, as the behaviour is not conforming to C++98, I would say that the test must be part of compile-fails for C++98 compilers, and state that in these compiler the test fails as expected. Of course the test must succeed on C++0x as boost::thread defines a constructor from a rvalue reference. Any other opinions? Vicente
participants (2)
-
Anthony Williams
-
vicente.botet