[Boost-bugs] [Boost C++ Libraries] #8162: lexical_cast is using math::changesign with long double regardless of whether BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS is defined or not.

Subject: [Boost-bugs] [Boost C++ Libraries] #8162: lexical_cast is using math::changesign with long double regardless of whether BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS is defined or not.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-24 00:49:26


#8162: lexical_cast is using math::changesign with long double regardless of
whether BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS is defined or not.
-------------------------------------+--------------------------------------
 Reporter: eric_niebler | Owner: apolukhin
     Type: Bugs | Status: new
Milestone: Boost 1.54.0 | Component: lexical_cast
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 Line 1399-1400 of `boost::lexical_cast` looks like this:

 {{{
 long double result = std::pow(10.0L, pow_of_10) * mantissa;
 value = static_cast<T>( has_minus ? (boost::math::changesign)(result) :
 result);
 }}}

 It turns out that this causes problems in the guts of Boost.Math when
 `BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS` is defined. This is causing
 Boost.Test build failures. See for instance [http://tinyurl.com/af5453h],
 which at the time of writing shows:

 {{{
     "g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -ftemplate-
 depth-1024 -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 -I".." -c -o
 "/usr/home/jim/boost_rt/trunk/results/boost/bin.v2/libs/xpressive/test/c_traits.test/gcc-4.2.1/debug
 /link-static/c_traits.o" "../libs/xpressive/test/c_traits.cpp"

 In file included from ../libs/xpressive/test/./regress.ipp:19,
                  from ../libs/xpressive/test/c_traits.cpp:15:
 ../boost/math/tools/promotion.hpp: In instantiation of
 'boost::math::tools::promote_args<long double, float, float, float, float,
 float>':
 ../boost/lexical_cast.hpp:1400: instantiated from here
 ../boost/math/tools/promotion.hpp:141: error: invalid application of
 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>' }}}

 Aside: there is no entry for lexical_cast in libs/maintainers.txt. There
 should be.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8162>
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-02-16 18:50:12 UTC