mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00
[libc++] Harden usage of static_assert against C++03
In C++03, we emulate static_assert with a macro, and we must parenthesize multiple arguments. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373328 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -644,8 +644,8 @@ _LIBCPP_CONSTEXPR _IntT __max_representable_int_for_float() _NOEXCEPT {
|
||||
static_assert(is_floating_point<_FloatT>::value, "must be a floating point type");
|
||||
static_assert(is_integral<_IntT>::value, "must be an integral type");
|
||||
static_assert(numeric_limits<_FloatT>::radix == 2, "FloatT has incorrect radix");
|
||||
static_assert(_IsSame<_FloatT, float>::value || _IsSame<_FloatT, double>::value
|
||||
|| _IsSame<_FloatT,long double>::value, "unsupported floating point type");
|
||||
static_assert((_IsSame<_FloatT, float>::value || _IsSame<_FloatT, double>::value
|
||||
|| _IsSame<_FloatT,long double>::value), "unsupported floating point type");
|
||||
return _FloatBigger ? numeric_limits<_IntT>::max() : (numeric_limits<_IntT>::max() >> _Bits << _Bits);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user