From 371ea70bb7f9c9e811c36371c647980c90763b37 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Tue, 1 Oct 2019 12:12:21 +0000 Subject: [PATCH] [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 --- libcxx/include/cmath | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcxx/include/cmath b/libcxx/include/cmath index 36d26b3..0f06486 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); } -- 2.7.4