Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC14 libstdc++: multiprecision/number.hpp redefines class std::numeric_limits<__float128> #560

Closed
jamborm opened this issue Jun 7, 2023 · 2 comments

Comments

@jamborm
Copy link

jamborm commented Jun 7, 2023

With (development version) of GCC 14 and its libstdc++ (after commit https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=f150a084e25 ), attempting to compile a file which includes multiprecision/number.hpp such as plain

#include "/home/mjambor/boost/boost/libs/multiprecision/include/boost/multiprecision/number.hpp"

fails with:

mjambor@virgil:/tmp/zzz$ ~/gcc/trunk/inst/bin/g++ -I /home/mjambor/boost/boost t2.cc -S
In file included from /home/mjambor/boost/boost/boost/cstdfloat.hpp:22,
                 from /home/mjambor/boost/boost/boost/multiprecision/detail/float128_functions.hpp:15,
                 from /home/mjambor/boost/boost/boost/multiprecision/detail/fpclassify.hpp:13,
                 from /home/mjambor/boost/boost/boost/multiprecision/detail/default_ops.hpp:15,
                 from /home/mjambor/boost/boost/boost/multiprecision/detail/generic_interconvert.hpp:12,
                 from /home/mjambor/boost/boost/libs/multiprecision/include/boost/multiprecision/number.hpp:12,
                 from t2.cc:1:
/home/mjambor/boost/boost/boost/math/cstdfloat/cstdfloat_limits.hpp:46:13: error: redefinition of ‘class std::numeric_limits<__float128>’
   46 |       class numeric_limits<boost::math::cstdfloat::detail::float_internal128_t>
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/mjambor/boost/boost/boost/limits.hpp:19,
                 from /home/mjambor/boost/boost/boost/integer_fwd.hpp:16,
                 from /home/mjambor/boost/boost/boost/integer.hpp:18,
                 from /home/mjambor/boost/boost/boost/multiprecision/detail/standalone_config.hpp:52,
                 from /home/mjambor/boost/boost/libs/multiprecision/include/boost/multiprecision/number.hpp:10:
/home/mjambor/gcc/trunk/inst/include/c++/14.0.0/limits:2079:12: note: previous definition of ‘class std::numeric_limits<__float128>’
 2079 |     struct numeric_limits<__float128>
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~

@mborland
Copy link
Member

mborland commented Jun 7, 2023

Confirmed and reported against Boost.Math here: boostorg/math#992.

@mborland
Copy link
Member

mborland commented Jun 8, 2023

Fixed by: boostorg/math#993

@mborland mborland closed this as completed Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants