Trying to build & run the regression tests for boost 1.55 on my Mac using the clang++ that comes with Xcode 5.1 ("Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)”), it can’t build config_test.cpp because BOOST_NO_CXX11_HDR_FUNCTIONAL isn’t set, and libs/config/test/boost_no_ccx_hdr_functional.ipp definitely doesn’t build (after renaming it to .cpp of course).
If I set CXXFLAGS to "-std=c++11 -stdlib=libc++” everything is fine, but I also need a build of boost that _doesn’t_ use c++11, and it’s the non-c++-11 version that is failing.
I can get around this by manually setting CXXFLAGS to “-DBOOST_NO_CXX11_HDR_FUNCTIONAL” but it seems like the correct way to do this is to add a test to boost/config/compiler/clang.hpp that tests … something… and then sets BOOST_NO_CXX11_HDR_FUNCTIONAL if appropriate.
1. Would you agree that’s the right place to set BOOST_NO_CXX11_HDR_FUNCTIONAL (when appropriate)?
2. Any suggestions on the correct test to determine whether BOOST_NO_CXX11_HDR_FUNCTIONAL is needed? It looks like the _has_feature() macro is the preferred method, but I can’t figure out which feature to check for …
Thanks,
Chris
p.s. The text of the 3 errors (when trying to compile boost_no_cxx_hdr_functional) is exceedingly lengthy, but to summarize:
usr/bin/../lib/c++/v1/__functional_base_03:962:22: error: no matching function for call to '__invoke'
typedef decltype(__invoke(_VSTD::declval<_Fp>())) type;
usr/bin/../lib/c++/v1/__config:496:32: note: expanded from macro 'decltype'
#define decltype(x) __typeof__(x)
usr/bin/../lib/c++/v1/__functional_base_03:1019:14: note: in instantiation of template class 'std::__1::__invoke_return