Opened 8 years ago

Closed 8 years ago

#10637 closed Bugs (obsolete)

Certain thread unit tests fail to compile on Xcode 6 because BOOST_NO_CXX11_SMART_PTR is not defined

Reported by: nat@… Owned by: viboes
Milestone: To Be Determined Component: config
Version: Boost 1.56.0 Severity: Regression
Keywords: tests Cc:

Description

./b2 toolset=darwin variant=release address-model=32 architecture=x86 -sNO_BZIP2=1 cxxflags=-Wno-c99-extensions cxxflags=-Wno-variadic-macros cxxflags=-Wno-unused-function cxxflags=-Wno-unused-const-variable libs/thread/test//async__async_p libs/thread/test//async__async_executor_p libs/thread/test//promise__set_rvalue_at_thread_exit_p

...
darwin.compile.c++ bin.v2/libs/thread/test/async__async_p.test/darwin-4.2.1/release/address-model-32/architecture-x86/threading-multi/sync/futures/async/async_pass.o
libs/thread/test/sync/futures/async/async_pass.cpp:129:10: error: calling a private constructor of class 'std::__1::unique_ptr<int, std::__1::default_delete<int> >'
  return boost::move(r);
         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:2464:5: note: declared private here
    unique_ptr(unique_ptr&);
    ^
darwin.compile.c++ bin.v2/libs/thread/test/async__async_executor_p.test/darwin-4.2.1/release/address-model-32/architecture-x86/threading-multi/sync/futures/async/async_executor_pass.o
In file included from libs/thread/test/sync/futures/async/async_executor_pass.cpp:34:
In file included from ./boost/thread/executors/basic_thread_pool.hpp:19:
In file included from ./boost/thread/csbl/vector.hpp:18:
./boost/container/vector.hpp:1526:72: warning: unused parameter 'last' [-Wunused-parameter]
   iterator insert(const_iterator pos, size_type num, InIt first, InIt last)
                                                                       ^
libs/thread/test/sync/futures/async/async_executor_pass.cpp:127:10: error: calling a private constructor of class 'std::__1::unique_ptr<int, std::__1::default_delete<int> >'
  return boost::move(r);
         ^
darwin.compile.c++ bin.v2/libs/thread/test/promise__set_rvalue_at_thread_exit_p.test/darwin-4.2.1/release/address-model-32/architecture-x86/threading-multi/syn\
c/futures/promise/set_rvalue_at_thread_exit_pass.o
In file included from libs/thread/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp:23:
./boost/thread/future.hpp:687:24: error: calling a private constructor of class 'std::__1::unique_ptr<int, std::__1::default_delete<int> >'
                return boost::move(*result);
                       ^
./boost/thread/future.hpp:2092:25: note: in instantiation of member function 'boost::detail::shared_state<std::__1::unique_ptr<int, std::__1::default_delete<in\
t> > >::get' requested here
            future_(new detail::shared_state<R>()),
                        ^

Change History (12)

comment:1 by nat@…, 8 years ago

Severity: ProblemRegression

This appears to be a regression. Although asyncasync_executor_p (async_executor_pass.cpp) does not appear in Boost 1.55.0, the other two unit tests pass in Boost 1.55.0.

comment:2 by viboes, 8 years ago

Please, could you tell me with which version, platform, compiler and C++ lib these error appear?

in reply to:  2 comment:3 by nat@…, 8 years ago

Replying to viboes:

Please, could you tell me with which version, platform, compiler and C++ lib these error appear?

version: Boost 1.56.0

platform: Mac OS X 10.9.5

g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0

library: thread

comment:4 by viboes, 8 years ago

I suspect that you are using option c++0x and libstdcpp. This is not supported.

in reply to:  4 comment:5 by nat@…, 8 years ago

Replying to viboes:

I suspect that you are using option c++0x and libstdcpp. This is not supported.

I pasted the b2 command line I used in the Description. How should I modify that command line?

comment:6 by viboes, 8 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

Oh, I'm really sorry. I believed that you were using clang.

It seems that default_delete is not movable with your default library. I suggest you to do the following.

In boost/thread/csbl/memory/unique_ptr.hpp, there is the following check

// 20.8.1 class template unique_ptr:
#if defined BOOST_NO_CXX11_SMART_PTR

You could define in your application BOOST_NO_CXX11_SMART_PTR

BTW, there are no problems inhttp://www.boost.org/development/tests/master/developer/thread.html for Sandia-darwin-4.2.1 Please, could you tell me if it works on develop or master branch, so that I can see what I can do if it is not the case?

P.S. in version 1.57 I'm using always movelib::unique_ptr.

Last edited 8 years ago by viboes (previous) (diff)

comment:7 by viboes, 8 years ago

After more thoughts, you should be compiling with c++98 and you have unique_ptr. This is a mess.

in reply to:  6 comment:8 by nat@…, 8 years ago

Replying to viboes:

You could define in your application BOOST_NO_CXX11_SMART_PTR

Please, could you tell me if it works on develop or master branch, so that I can see what I can do if it is not the case?

Thank you! Adding BOOST_NO_CXX11_SMART_PTR to the b2 command line does indeed permit these tests to pass:

./b2 toolset=darwin variant=release address-model=32 architecture=x86 -sNO_BZIP2=1 cxxflags=-DBOOST_NO_CXX11_SMART_PTR cxxflags=-Wno-c99-extensions cxxflags=-Wno-variadic-macros cxxflags=-Wno-unused-function cxxflags=-Wno-unused-const-variable libs/thread/test//async__async_p libs/thread/test//async__async_executor_p libs/thread/test//promise__set_rvalue_at_thread_exit_p

comment:9 by viboes, 8 years ago

Component: threadconfig
Summary: Certain thread unit tests fail to compile on Xcode 6Certain thread unit tests fail to compile on Xcode 6 because BOOST_NO_CXX11_SMART_PTR is not defined

So resuming you are using the following command line with c++98 and BOOST_NO_CXX11_SMART_PTR is not defined.

./b2 toolset=darwin variant=release address-model=32 architecture=x86 -sNO_BZIP2=1 cxxflags=-DBOOST_NO_CXX11_SMART_PTR cxxflags=-Wno-c99-extensions cxxflags=-Wno-variadic-macros cxxflags=-Wno-unused-function cxxflags=-Wno-unused-const-variable libs/thread/test//async__async_p libs/thread/test//async__async_executor_p libs/thread/test//promise__set_rvalue_at_thread_exit_p

Moving it to Boost.Config then.

comment:10 by John Maddock, 8 years ago

Sorry to be late coming to this - that macro should be set for all GCC-4.3 and earlier (including your 4.2.x install) in boost/config/stdlib/libstdcpp3.hpp. Can you see why the branch starting:

#if (BOOST_LIBSTDCXX_VERSION < 40400)
!defined(BOOST_LIBSTDCXX11)

Is not being taken on your system?

Thanks, John.

comment:11 by nat@…, 8 years ago

I'm sorry. At some point a couple months ago the config did start defining that symbol, so I removed our explicit definition because it was producing a ton of duplicate-macro warnings. I've reviewed our changelog. The only change (between introducing BOOST_NO_CXX11_SMART_PTR and removing it again) that suggests itself as a possible cause is that we set the Mac OS X SDK to 10.9. I confess I don't know what effect that has on the set of predefined macros.

Shortly after removing BOOST_NO_CXX11_SMART_PTR, we updated our Boost source to 1.57. Notably, though, that changeset was committed after the changeset removing BOOST_NO_CXX11_SMART_PTR.

In any case, I should have updated this ticket to note that the problem no longer manifests for us.

comment:12 by John Maddock, 8 years ago

Resolution: obsolete
Status: assignedclosed

OK thanks, closing down, please reopen if it comes back again or you can provide more info.

Note: See TracTickets for help on using tickets.