Hide Forgot
Description of problem: Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Create a simple file like #include <boost/lexical_cast.hpp> #include <parallel/algorithm> #include <iostream> int main(int argc, char **argv) { std::cout << "hello, world!" << std::endl; } 2. Compile it Actual results: In file included from /usr/include/c++/6.0.0/tr1/random:46:0, from /usr/include/c++/6.0.0/parallel/random_number.h:36, from /usr/include/c++/6.0.0/parallel/partition.h:38, from /usr/include/c++/6.0.0/parallel/quicksort.h:36, from /usr/include/c++/6.0.0/parallel/sort.h:48, from /usr/include/c++/6.0.0/parallel/algo.h:45, from /usr/include/c++/6.0.0/parallel/algorithm:37, from test.cc:2: /usr/include/c++/6.0.0/tr1/cmath: In function ‘float std::tr1::acosh(float)’: /usr/include/c++/6.0.0/tr1/cmath:424:18: error: ‘float std::tr1::acosh(float)’ conflicts with a previous declaration acosh(float __x) ^ In file included from /usr/include/boost/config/no_tr1/cmath.hpp:21:0, from /usr/include/boost/numeric/conversion/converter_policies.hpp:15, from /usr/include/boost/numeric/conversion/converter.hpp:14, from /usr/include/boost/numeric/conversion/cast.hpp:33, from /usr/include/boost/lexical_cast/detail/converter_numeric.hpp:37, from /usr/include/boost/lexical_cast/try_lexical_convert.hpp:41, from /usr/include/boost/lexical_cast.hpp:32, from test.cc:1: /usr/include/c++/6.0.0/cmath:1224:3: note: previous declaration ‘constexpr float std::acosh(float)’ acosh(float __x) ^~~~~ etc. etc. etc. Expected results: should compile cleanly as it does with gcc-5.3.1-2.fc23.x86_64 on Fedora 23. Additional info: Switching the order of the two includes works around the problem.
This isn't a problem with Boost, it's just that <boost/lexical_cast.hpp> includes <math.h> and <parallel/algorithm> includes <tr1/cmath> which was not compatible with <math.h> in C++14 mode. This is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69893 which is already fixed upstream.
Seems to be fixed in gcc-6.0.0-0.13.fc24.x86_64. Thanks for the extremely fast response.