Boost logo

Boost :

Subject: [boost] Compile error on function.mem_fun_cxx98 regression test
From: Chris Cooper (chris.cooper_at_[hidden])
Date: 2014-04-08 12:24:54

I’m trying to get all of the regression tests to work on my Mac which is running OSX 10.9.2 with Xcode 5.1. "clang++ —version” reports “Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)”. I’m building the boost libraries for c++11.

I realize boost 1.55 doesn’t officially support this compiler (yet) so I’m out on the bleeding edge, but it’s almost working. I am cheating a little by manually applying a few of the post-1.55 patches, and if I need to do that to get the regression tests to build that’s fine.

When I try to compile function.mem_fun_cxx98 it gives me this error:

mem_fun_cxx98.cpp:34:46: error: invalid operands to binary expression ('std::__1::basic_ostream<char>' and 'ostream' (aka 'basic_ostream<char>'))
    BOOST_TEST(f2(&x, boost::ref(std::cout)) == std::cout);
../../../boost/detail/lightweight_test.hpp:186:28: note: expanded from macro 'BOOST_TEST'
#define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION))
1 error generated.

The error looked to me like a stdlib vs. libc++ kind of thing, so I double-checked the compiler options. For the regression test, bjam is calling the compiler like so:

 "clang++" -x c++ -std=c++11 -stdlib=libc++ -O3 -O3 -finline-functions -Wno-inline -Wall -DBOOST_ALL_NO_LIB=1 -DNDEBUG -I"../../.." -c -o "/tmp/boost/bin.v2/libs/function/test/mem_fun_cxx98.test/clang-darwin-4.2.1/release/link-static/threading-multi/libs/function/test/mem_fun_cxx98.o” “[SNIP]/mem_fun_cxx98.cpp"

The boost libraries are build by calling the compiler:

"clang++" -x c++ -std=c++11 -stdlib=libc++ -O3 -O3 -finline-functions -Wno-inline -Wall -DBOOST_ALL_NO_LIB=1 -DBOOST_COROUTINES_SOURCE -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG -I"." -c -o “[SNIP]/bin/boost/bin.v2/libs/coroutine/build/clang-darwin-4.2.1/release/link-static/threading-multi/exceptions.o" "libs/coroutine/src/exceptions.cpp"

Whether I bootstrap for toolset clang or darwin doesn’t seem to change anything.
Building the library and regression test using clang++ without the c++11 flags works correctly.

Is this a known problem that has already been patched for the 1.56 release (I can’t find it if so)?
Any suggestions on why this might be happening?


Boost list run by bdawes at, gregod at, cpdaniel at, john at