summaryrefslogtreecommitdiffstats
path: root/libcxx/include/cmath
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2019-10-01 12:12:21 +0000
committerLouis Dionne <ldionne@apple.com>2019-10-01 12:12:21 +0000
commit371ea70bb7f9c9e811c36371c647980c90763b37 (patch)
tree783ba1fb3737daed1e3d339ab59e3f8977857437 /libcxx/include/cmath
parented5a8971ecff1e8e51ced7f44e3f6bb71fd97086 (diff)
downloadbcm5719-llvm-371ea70bb7f9c9e811c36371c647980c90763b37.tar.gz
bcm5719-llvm-371ea70bb7f9c9e811c36371c647980c90763b37.zip
[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. llvm-svn: 373328
Diffstat (limited to 'libcxx/include/cmath')
-rw-r--r--libcxx/include/cmath4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/include/cmath b/libcxx/include/cmath
index 36d26b38760..0f06486fb34 100644
--- a/libcxx/include/cmath
+++ b/libcxx/include/cmath
@@ -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);
}
OpenPOWER on IntegriCloud