#36960: boost @1.52.0 build error in chrono caused by CONSTEXPR ------------------------------+-------------------------------- Reporter: alain.dewagter@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Keywords: boost,chrono | Port: boost ------------------------------+-------------------------------- I updated boost port to to version 1.52.0 (@99457), and now I get this compiling error: {{{ error: constexpr function never produces a constant expression }}} in include/boost/chrono/duration.hpp at lines starting with ">>": {{{ template <> struct chrono_numeric_limits<float,true> {
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW { return -(std::numeric_limits<float>::max) (); } };
template <> struct chrono_numeric_limits<double,true> {
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW { return -(std::numeric_limits<double>::max) (); } };
template <> struct chrono_numeric_limits<long double,true> {
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW { return -(std::numeric_limits<long double>::max)(); } }; }}}
I reverted to version 1.51.0, as it works fine on this version which has this code: {{{ namespace detail { template <class T, bool = is_arithmetic<T>::value> struct chrono_numeric_limits { static T lowest() throw() {return (std::numeric_limits<T>::min) ();} }; template <class T> struct chrono_numeric_limits<T,true> { static T lowest() throw() {return (std::numeric_limits<T>::min) ();} }; template <> struct chrono_numeric_limits<float,true> { static float lowest() throw() { return -(std::numeric_limits<float>::max) (); } }; template <> struct chrono_numeric_limits<double,true> { static double lowest() throw() { return -(std::numeric_limits<double>::max) (); } }; template <> struct chrono_numeric_limits<long double,true> { static long double lowest() throw() { return -(std::numeric_limits<long double>::max)(); } }; template <class T> struct numeric_limits : chrono_numeric_limits<typename remove_cv<T>::type> {}; } }}} I am using the latest version for OSX and Xcode: OS: 10.8.2 (12C60) Xcode: 4.5.2 (4G2008a) Please update the port to fix this issue. Thank you! Alain -- Ticket URL: <https://trac.macports.org/ticket/36960> MacPorts <http://www.macports.org/> Ports system for Mac OS