Bug 1312402

Summary: Bad interaction between boost/lexical_cast.hpp and parallel/algorithm with gcc-6.0.0-0.12.fc24.x86_64
Product: [Fedora] Fedora Reporter: nvwarr
Component: gccAssignee: Jonathan Wakely <jwakely>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 24CC: dakingun, davejohansen, denis.arnaud_fedora, jakub, jwakely, law, me, mpolacek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-01 08:03:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description nvwarr 2016-02-26 15:50:26 UTC
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.

Comment 1 Jonathan Wakely 2016-02-26 17:47:24 UTC
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.

Comment 2 nvwarr 2016-03-01 08:03:23 UTC
Seems to be fixed in gcc-6.0.0-0.13.fc24.x86_64. Thanks for the extremely fast response.