Bug 1312402 - Bad interaction between boost/lexical_cast.hpp and parallel/algorithm with gcc-6.0.0-0.12.fc24.x86_64
Summary: Bad interaction between boost/lexical_cast.hpp and parallel/algorithm with gc...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 24
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jonathan Wakely
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-26 15:50 UTC by nvwarr
Modified: 2016-03-01 08:03 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-01 08:03:23 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 69893 0 None None None 2016-02-26 17:47:23 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.