________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of Fletcher, John P [j.p.fletcher@aston.ac.uk] Sent: 18 January 2015 11:09 To: boost@lists.boost.org Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers ________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of Fletcher, John P [j.p.fletcher@aston.ac.uk] Sent: 18 January 2015 09:59 To: boost@lists.boost.org Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers ________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of John Maddock [boost.regex@virgin.net] Sent: 18 January 2015 09:17 To: boost@lists.boost.org Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers
Actually, I'm not so sure the problem is on my side, as shared_ptr.hpp does appear to #include <memory> itself. It could be that BOOST_NO_CXX11_ALLOCATOR is not being defined properly for your configuration, so it's possible that the problem might be in Boost.Config.
What standard library is your installation of Clang using?
Thanks for the quick feedback everyone! How do I check what library its using? I'm not very comfortable in linux environment and I've done most of my development on Windows. Really appreciate the help.
Most complete solution is to build and run libs/config/test/config_info.cpp and report the program output - that should give us everything we could ever wish to know ;-) John. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost I have done some quick tests on this with various versions of Clang on Ubunbtu 12.04 Clang 3,4, 3,5 3,6 (not yet released). All work with C++03 , All fail with C++11 and the default libraries from gcc (4.6 on my system) All work with C++11 and a version of libc++, contemporary with the compiler. I hope this helps. More information available. John _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost I have done some more tests and the failing cased run if the following is in the compile line before the includes: -DBOOST_NO_CXX11_ALLOCATOR The explanation is in this code in boost/smart_ptr/detail/shared_ptr.hpp #if !defined( BOOST_NO_CXX11_ALLOCATOR ) typedef typename std::allocator_traits<A>::template rebind_alloc< impl_type > A2; #else typedef typename A::template rebind< impl_type >::other A2; #endif There is a need for some sorting out in the configuration. I hope this helps John _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost Digging into the configuration, boost/config/stdlib/libstdcpp3.hpp is the place where BOOST_NO_CXX11_ALLOCATOR is defined. It is defined for BOOST_LIBSTDCXX_VERSION < 40700 Unfortunately the implementation of clang identifies the libstdc++ with gcc as BOOST_LIBSTDCXX_VERSION = 40700 (which implies gcc 4.7) and so does not set BOOST_NO_CXX11_ALLOCATOR gcc 4.6.3 is the default gcc on ubuntu 12.04, which is a long support version. The quick solution is to move the setting of # define BOOST_NO_CXX11_ALLOCATOR into the section (BOOST_LIBSTDCXX_VERSION < 40800). I have tried this locally and it works for me. John