Opened 10 years ago
Closed 10 years ago
#8367 closed Bugs (fixed)
chrono does not compile with clang from XCode 4.5.2 with -std=c++11 -stdlib=libc++ and -arch armv7
Reported by: | Owned by: | viboes | |
---|---|---|---|
Milestone: | Boost 1.54.0 | Component: | chrono |
Version: | Boost 1.53.0 | Severity: | Showstopper |
Keywords: | Cc: |
Description (last modified by )
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++" ;
Attachments (1)
Change History (9)
by , 10 years ago
Attachment: | clang_chrono.txt added |
---|
comment:1 by , 10 years ago
Description: | modified (diff) |
---|---|
Status: | new → assigned |
follow-up: 4 comment:2 by , 10 years ago
BOOST_NO_CXX11_NUMERIC_LIMITS is undefined.
Here's the extract of clangs config file:
#define _LIBCPP_VERSION 1101 #define _LIBCPP_ABI_VERSION 1
The problem is related to the combination of -std=c++11 and -stdlib=libc++. If I use only one of them, everything is fine.
follow-up: 5 comment:3 by , 10 years ago
This was fixed (by Apple) as part of the Xcode 4.6 release.
Specifically, std::numeric_limits<>::max()
is now constexpr.
comment:4 by , 10 years ago
Replying to Franz Detro <franz.detro@…>:
BOOST_NO_CXX11_NUMERIC_LIMITS is undefined.
Here's the extract of clangs config file:
#define _LIBCPP_VERSION 1101 #define _LIBCPP_ABI_VERSION 1The problem is related to the combination of -std=c++11 and -stdlib=libc++. If I use only one of them, everything is fine.
Please could you try the following patch
#if defined( BOOST_NO_CXX11_NUMERIC_LIMITS ) #define BOOST_CHRONO_LIB_CONSTEXPR #elif defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 1101 #define BOOST_CHRONO_LIB_CONSTEXPR #else #define BOOST_CHRONO_LIB_CONSTEXPR BOOST_CONSTEXPR #endif
comment:5 by , 10 years ago
Replying to marshall:
This was fixed (by Apple) as part of the Xcode 4.6 release.
Specifically,
std::numeric_limits<>::max()
is now constexpr.
Do you know since which _LIBCPP_VERSION this is fixed?
comment:6 by , 10 years ago
_LIBCPP_VERSION was changed to 1101 soon after std::numeric_limits<>::max()
was marked as constexpr.
You can check for that, or use #ifdef _LIBCPP_CONSTEXPR
which was added at the same time as the change.
comment:7 by , 10 years ago
Milestone: | To Be Determined → Boost 1.54.0 |
---|
Thanks for the info. Committed revision [83842].
comment:8 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The error appears when the standard library doesn't uses constexpr for max()
BOOST_CHRONO_LIB_CONSTEXPR is defined as follows
Could you tell me what is the value of BOOST_NO_CXX11_NUMERIC_LIMITS and _LIBCPP_VERSION on the environment you get the error?