Subject: [Boost-bugs] [Boost C++ Libraries] #12969: Problem linking print_helper_t<nullptr_t> under Clang
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-04-13 17:53:19
#12969: Problem linking print_helper_t<nullptr_t> under Clang
-------------------------------------------------+-------------------------
Reporter: Tony Lewis <TonyELewis@â¦> | Owner: rogeeff
Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
Version: Boost 1.64.0 | Severity: Problem
Keywords: |
test,link,print_helper_t,nullptr,nullptr_t,1_64_0_b2|
-------------------------------------------------+-------------------------
I'm trying out 1.64.0 b2...
I can get the following code to compile, link and run under GCC :
{{{
#!cpp
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE( plv_tc ) {
BOOST_TEST( nullptr == nullptr );
}
bool init_function() { return true; }
int main( int argc, char* argv[] ) {
return ::boost::unit_test::unit_test_main( &init_function, argc,
argv );
}
}}}
...with commands:
{{{
setenv BOOST_ROOT /opt/boost_1_64_0_b2_gcc_build
setenv LD_LIBRARY_PATH $BOOST_ROOT/lib
g++ -std=c++11 -isystem $BOOST_ROOT/include boost-test.nullptr-problem.cpp
-L$BOOST_ROOT/lib -lboost_unit_test_framework-mt
./a.out
}}}
...but if I try with Clang:
{{{
setenv BOOST_ROOT /opt/boost_1_64_0_b2_clang_build
setenv LD_LIBRARY_PATH $BOOST_ROOT/lib
clang++ -std=c++11 -stdlib=libc++ -isystem $BOOST_ROOT/include boost-test
.nullptr-problem.cpp -L$BOOST_ROOT/lib -lboost_unit_test_framework-mt
}}}
...I get:
{{{
/tmp/boost-test-fe7931.o: In function `std::__1::basic_ostream<char,
std::__1::char_traits<char> >& boost::test_tools::tt_detail::operator<<
<decltype(nullptr)>(std::__1::basic_ostream<char,
std::__1::char_traits<char> >&,
boost::test_tools::tt_detail::print_helper_t<decltype(nullptr)> const&)':
boost-test.nullptr-
problem.cpp:(.text._ZN5boost10test_tools9tt_detaillsIDnEERNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEES8_RKNS1_14print_helper_tIT_EE[_ZN5boost10test_tools9tt_detaillsIDnEERNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEES8_RKNS1_14print_helper_tIT_EE]+0x26):
undefined reference to
`boost::test_tools::tt_detail::print_log_value<decltype(nullptr)>::operator()(std::__1::basic_ostream<char,
std::__1::char_traits<char> >&, decltype(nullptr))'
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
}}}
I may well just be doing something stupid - apologies if so.
I'm using Clang++ 3.8.1 and GCC 6.2.0 on Ubuntu 16.10 (Linux
4.8.0-46-generic; x86_64).
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12969> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-04-13 17:56:20 UTC