clang++ isn't getting the BOOST_NO_CXX11_HDR_FUNCTIONAL flag that it needs
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
On Tue, Apr 15, 2014 at 3:48 PM, Chris Cooper
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)? The right place is .../config/stdlib/libcpp.hpp since what header is available is a function of the library rather than the compiler. The current version of libcpp.hpp is pretty rudimentary and doesn't test for specific versions of libc++. You might want to read "Best way to detect libc++ at compile time?" See http://clang-developers.42468.n3.nabble.com/Best-way-to-detect-libc-at-compi... It would certainly be nice to get a patch to update libcpp.hpp. Thanks, --Beman
On 04/16/2014 06:08 AM, Beman Dawes wrote:
On Tue, Apr 15, 2014 at 3:48 PM, Chris Cooper wrote:
1. Would you agree that’s the right place to set BOOST_NO_CXX11_HDR_FUNCTIONAL (when appropriate)?
The right place is .../config/stdlib/libcpp.hpp since what header is available is a function of the library rather than the compiler.
The current version of libcpp.hpp is pretty rudimentary and doesn't test for specific versions of libc++. You might want to read "Best way to detect libc++ at compile time?"
See http://clang-developers.42468.n3.nabble.com/Best-way-to-detect-libc-at-compi...
It would certainly be nice to get a patch to update libcpp.hpp.
Just be sure that you don't break clang with libstdc++ since that's a common configuration, too. Eric
participants (3)
-
Beman Dawes
-
Chris Cooper
-
Eric Niebler