summaryrefslogtreecommitdiffstats
path: root/libcxx/include/cmath
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2014-10-17 00:31:47 +0000
committerEric Fiselier <eric@efcs.ca>2014-10-17 00:31:47 +0000
commit07df631129ee5464edaad7eea9e203d4a109f259 (patch)
tree5d32de245dab2141be933cacd7e2a7a6dfe1d80d /libcxx/include/cmath
parent1444bb9fc8ff56ae7dc2f9f22fa3518f91dc8d1f (diff)
downloadbcm5719-llvm-07df631129ee5464edaad7eea9e203d4a109f259.tar.gz
bcm5719-llvm-07df631129ee5464edaad7eea9e203d4a109f259.zip
[libcxx] Fix SFINAE in <cmath>. Patch from K-Ballo.
Delay instantiation of `__numeric_type` within <cmath>, don't instantiate it when the `is_arithmetic` conditions do not hold as it causes errors with user-defined types with ambiguous conversions. Fixes PR21083. llvm-svn: 219998
Diffstat (limited to 'libcxx/include/cmath')
-rw-r--r--libcxx/include/cmath48
1 files changed, 24 insertions, 24 deletions
diff --git a/libcxx/include/cmath b/libcxx/include/cmath
index 4719abad3ca..d3aa4beeb58 100644
--- a/libcxx/include/cmath
+++ b/libcxx/include/cmath
@@ -727,11 +727,11 @@ inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long do
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT
{
@@ -849,11 +849,11 @@ inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long dou
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
@@ -952,11 +952,11 @@ inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long doub
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
@@ -1114,11 +1114,11 @@ inline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __lcpp_x, long
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
@@ -1192,11 +1192,11 @@ inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long dou
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
@@ -1216,12 +1216,12 @@ inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long doub
template <class _A1, class _A2, class _A3>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value &&
is_arithmetic<_A3>::value,
- typename __promote<_A1, _A2, _A3>::type
+ __promote<_A1, _A2, _A3>
>::type
fma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
{
@@ -1242,11 +1242,11 @@ inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long dou
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
@@ -1266,11 +1266,11 @@ inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long dou
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
@@ -1290,11 +1290,11 @@ inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long do
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
@@ -1459,11 +1459,11 @@ inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, lon
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
@@ -1496,11 +1496,11 @@ inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, lon
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
@@ -1520,11 +1520,11 @@ inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long d
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
remquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT
{
OpenPOWER on IntegriCloud