From a600a25e3ea5715262299f032796a83bf7ee330e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 11 Nov 2019 17:41:56 +0000 Subject: [PATCH] Merge commit 371ea70bb from llvm git (by Louis Dionne): [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 This is a follow-up to r354460, which causes errors for pre-C++11 programs using , similar to: /usr/include/c++/v1/cmath:622:68: error: too many arguments provided to function-like macro invocation Reported by: antoine MFC after: immediately (because of ports breakage) --- contrib/libc++/include/cmath | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/libc++/include/cmath b/contrib/libc++/include/cmath index 36d26b38760f..0f06486fb34f 100644 --- a/contrib/libc++/include/cmath +++ b/contrib/libc++/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); }