Changes between Initial Version and Version 1 of Ticket #8367


Ignore:
Timestamp:
Apr 8, 2013, 5:44:33 PM (10 years ago)
Author:
viboes
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?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8367

    • Property Status newassigned
  • Ticket #8367 – Description

    initial v1  
    44
    55one gets compile errors. Compile log attached.
     6
     7I'm using the following configuration and everything is right.
     8
     9{{{
     10using clang : 3.2 : /Users/viboes/clang/clang+llvm-3.2-x86_64-apple-darwin11/bin/clang++ ;
     11using 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++" ;
     12}}}