Subject: [Boost-bugs] [Boost C++ Libraries] #2961: Boost 1.38.0 fails to compile on g++-4.0.2
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-04-19 17:20:57
#2961: Boost 1.38.0 fails to compile on g++-4.0.2
---------------------------------------------+------------------------------
Reporter: Alex Shapiro <alexsh_at_[hidden]> | Owner: johnmaddock
Type: Bugs | Status: new
Milestone: Boost 1.39.0 | Component: math
Version: Boost 1.38.0 | Severity: Showstopper
Keywords: 4.0.2, math, test_is_policy |
---------------------------------------------+------------------------------
Boost 1.38.0 fails to compile on g++-4.0.2 on x86 Linux (while -4.0.1 is a
tested target). The code compiles on g++-3.4.3.
The offending file is
source:/tags/release/Boost_1_38_0/boost/math/policies/policy.hpp . I'm
sorry, that I don't have the full error message here, it's at work, and I
don't have the specific compiler setup at home.
{{{
namespace detail{
template <class A1,
class A2,
class A3,
class A4,
class A5,
class A6,
class A7,
class A8,
class A9,
class A10,
class A11>
char test_is_policy(const policy<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11>*);
double test_is_policy(...);
template <class P>
struct is_policy_imp
{
BOOST_STATIC_CONSTANT(bool, value =
(sizeof(test_is_policy(static_cast<P*>(0))) == 1));
};
}
}}}
The error says that:
{{{ "test_is_policy" undefined at scope }}}, at line {{{
BOOST_STATIC_CONSTANT(bool, value =
(sizeof(test_is_policy(static_cast<P*>(0))) == 1)); }}}
Solution:
Replace {{{ sizeof(test_is_policy(static_cast<P*>(0))) }}} with {{{
sizeof(boost::math::policy::detail::test_is_policy(static_cast<P*>(0)))
}}}
Note: the same fix probably applies to
source:/trunk/boost/math/policies/policy.hpp
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2961> 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:00 UTC