Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8367: chrono does not compile with clang from XCode 4.5.2 with -std=c++11 -stdlib=libc++ and -arch armv7
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-08 17:44:33
#8367: chrono does not compile with clang from XCode 4.5.2 with -std=c++11
-stdlib=libc++ and -arch armv7
--------------------------------------------------------------+-------------
Reporter: Franz Detro <franz.detro@â¦> | Owner: viboes
Type: Bugs | Status: assigned
Milestone: To Be Determined | Component: chrono
Version: Boost 1.53.0 | Severity: Showstopper
Resolution: | Keywords:
--------------------------------------------------------------+-------------
Changes (by viboes):
* status: new => assigned
Old description:
> When trying to compile chrono with the Xcode 4.5.2 clang compiler on
> MacOS X for iOS with
>
> -std=c++11 -stdlib=libc++ and -arch armv7
>
> one gets compile errors. Compile log attached.
New description:
When trying to compile chrono with the Xcode 4.5.2 clang compiler on MacOS
X for iOS with
-std=c++11 -stdlib=libc++ and -arch armv7
one gets compile errors. Compile log attached.
I'm using the following configuration and everything is right.
{{{
using clang : 3.2 : /Users/viboes/clang/clang+llvm-3.2-x86_64-apple-
darwin11/bin/clang++ ;
using clang : 3.2xl : /Users/viboes/clang/clang+llvm-3.2-x86_64-apple-
darwin11/bin/clang++ : <cxxflags>"-std=c++11 -stdlib=libc++"
<linkflags>"-std=c++11 -stdlib=libc++" ;
}}}
--
Comment:
The error appears when the standard library doesn't uses constexpr for
max()
{{{
41 ./boost/chrono/duration.hpp:353:49: error: constexpr function
never produces a constant expression
42 static BOOST_CHRONO_LIB_CONSTEXPR float lowest()
BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
43 ^
44 ./boost/chrono/duration.hpp:355:21: note: non-constexpr function
'max' cannot be used in a constant expression
45 return -(std::numeric_limits<float>::max) ();
46 ^
}}}
BOOST_CHRONO_LIB_CONSTEXPR is defined as follows
{{{
#if defined( BOOST_NO_CXX11_NUMERIC_LIMITS )
#define BOOST_CHRONO_LIB_CONSTEXPR
#elif defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 1002
#define BOOST_CHRONO_LIB_CONSTEXPR
#else
#define BOOST_CHRONO_LIB_CONSTEXPR BOOST_CONSTEXPR
#endif
}}}
Could you tell me what is the value of BOOST_NO_CXX11_NUMERIC_LIMITS and
_LIBCPP_VERSION on the environment you get the error?
--
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8367#comment:1>
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