Commit b04fa738 by Paolo Carlini Committed by Paolo Carlini

re PR libstdc++/48933 (Infinite recursion in tr1/cmath functions with complex parameters)

2011-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/48933
	* include/c_global/cmath (acosh, asinh, atanh, cbrt, copysign,
	erf, erfc, exp2, expm1, fdim, fma, fmax, hypot, ilogb, lgamma,
	llrint, llround, log1p, log2, logb, lrint, lround, nearbyint,
	nextafter, nexttoward, remainder, remquo, rint, round, scalbln,
	scalbn, tgamma, trunc): Use __enable_if on the return type.
	* include/tr1/cmath: Likewise.
	* testsuite/26_numerics/headers/cmath/overloads_c++0x_neg.cc: New.
	* testsuite/tr1/8_c_compatibility/cmath/overloads_neg.cc: Likewise.

From-SVN: r173574
parent a9e6994a
2011-05-09 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/48933
* include/c_global/cmath (acosh, asinh, atanh, cbrt, copysign,
erf, erfc, exp2, expm1, fdim, fma, fmax, hypot, ilogb, lgamma,
llrint, llround, log1p, log2, logb, lrint, lround, nearbyint,
nextafter, nexttoward, remainder, remquo, rint, round, scalbln,
scalbn, tgamma, trunc): Use __enable_if on the return type.
* include/tr1/cmath: Likewise.
* testsuite/26_numerics/headers/cmath/overloads_c++0x_neg.cc: New.
* testsuite/tr1/8_c_compatibility/cmath/overloads_neg.cc: Likewise.
2011-05-07 François Dumont <francois.cppdevs@free.fr> 2011-05-07 François Dumont <francois.cppdevs@free.fr>
* include/debug/macro.h (_GLIBCXX_DEBUG_VERIFY_AT): New. * include/debug/macro.h (_GLIBCXX_DEBUG_VERIFY_AT): New.
......
// -*- C++ -*- C forwarding header. // -*- C++ -*- C forwarding header.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007, 2008, 2009, 2010 // 2006, 2007, 2008, 2009, 2010, 2011
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -1120,12 +1120,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1120,12 +1120,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_acoshl(__x); } { return __builtin_acoshl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
acosh(_Tp __x) acosh(_Tp __x)
{ { return __builtin_acosh(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return acosh(__type(__x));
}
inline float inline float
asinh(float __x) asinh(float __x)
...@@ -1136,12 +1134,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1136,12 +1134,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_asinhl(__x); } { return __builtin_asinhl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
asinh(_Tp __x) asinh(_Tp __x)
{ { return __builtin_asinh(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return asinh(__type(__x));
}
inline float inline float
atanh(float __x) atanh(float __x)
...@@ -1152,12 +1148,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1152,12 +1148,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_atanhl(__x); } { return __builtin_atanhl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
atanh(_Tp __x) atanh(_Tp __x)
{ { return __builtin_atanh(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return atanh(__type(__x));
}
inline float inline float
cbrt(float __x) cbrt(float __x)
...@@ -1168,12 +1162,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1168,12 +1162,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_cbrtl(__x); } { return __builtin_cbrtl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
cbrt(_Tp __x) cbrt(_Tp __x)
{ { return __builtin_cbrt(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return cbrt(__type(__x));
}
inline float inline float
copysign(float __x, float __y) copysign(float __x, float __y)
...@@ -1184,7 +1176,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1184,7 +1176,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_copysignl(__x, __y); } { return __builtin_copysignl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
copysign(_Tp __x, _Up __y) copysign(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1200,12 +1196,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1200,12 +1196,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_erfl(__x); } { return __builtin_erfl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
erf(_Tp __x) erf(_Tp __x)
{ { return __builtin_erf(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return erf(__type(__x));
}
inline float inline float
erfc(float __x) erfc(float __x)
...@@ -1216,12 +1210,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1216,12 +1210,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_erfcl(__x); } { return __builtin_erfcl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
erfc(_Tp __x) erfc(_Tp __x)
{ { return __builtin_erfc(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return erfc(__type(__x));
}
inline float inline float
exp2(float __x) exp2(float __x)
...@@ -1232,12 +1224,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1232,12 +1224,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_exp2l(__x); } { return __builtin_exp2l(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
exp2(_Tp __x) exp2(_Tp __x)
{ { return __builtin_exp2(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return exp2(__type(__x));
}
inline float inline float
expm1(float __x) expm1(float __x)
...@@ -1248,12 +1238,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1248,12 +1238,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_expm1l(__x); } { return __builtin_expm1l(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
expm1(_Tp __x) expm1(_Tp __x)
{ { return __builtin_expm1(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return expm1(__type(__x));
}
inline float inline float
fdim(float __x, float __y) fdim(float __x, float __y)
...@@ -1264,7 +1252,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1264,7 +1252,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fdiml(__x, __y); } { return __builtin_fdiml(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fdim(_Tp __x, _Up __y) fdim(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1280,7 +1272,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1280,7 +1272,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fmal(__x, __y, __z); } { return __builtin_fmal(__x, __y, __z); }
template<typename _Tp, typename _Up, typename _Vp> template<typename _Tp, typename _Up, typename _Vp>
inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type inline
typename __gnu_cxx::__promote_3<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value
&& __is_arithmetic<_Vp>::__value,
_Tp>::__type, _Up, _Vp>::__type
fma(_Tp __x, _Up __y, _Vp __z) fma(_Tp __x, _Up __y, _Vp __z)
{ {
typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type; typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
...@@ -1296,7 +1293,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1296,7 +1293,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fmaxl(__x, __y); } { return __builtin_fmaxl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fmax(_Tp __x, _Up __y) fmax(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1312,7 +1313,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1312,7 +1313,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fminl(__x, __y); } { return __builtin_fminl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fmin(_Tp __x, _Up __y) fmin(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1328,7 +1333,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1328,7 +1333,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_hypotl(__x, __y); } { return __builtin_hypotl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
hypot(_Tp __x, _Up __y) hypot(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1344,12 +1353,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1344,12 +1353,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_ilogbl(__x); } { return __builtin_ilogbl(__x); }
template<typename _Tp> template<typename _Tp>
inline int inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
int>::__type
ilogb(_Tp __x) ilogb(_Tp __x)
{ { return __builtin_ilogb(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return ilogb(__type(__x));
}
inline float inline float
lgamma(float __x) lgamma(float __x)
...@@ -1360,12 +1367,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1360,12 +1367,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_lgammal(__x); } { return __builtin_lgammal(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
lgamma(_Tp __x) lgamma(_Tp __x)
{ { return __builtin_lgamma(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return lgamma(__type(__x));
}
inline long long inline long long
llrint(float __x) llrint(float __x)
...@@ -1376,12 +1381,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1376,12 +1381,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_llrintl(__x); } { return __builtin_llrintl(__x); }
template<typename _Tp> template<typename _Tp>
inline long long inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
long long>::__type
llrint(_Tp __x) llrint(_Tp __x)
{ { return __builtin_llrint(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return llrint(__type(__x));
}
inline long long inline long long
llround(float __x) llround(float __x)
...@@ -1392,12 +1395,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1392,12 +1395,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_llroundl(__x); } { return __builtin_llroundl(__x); }
template<typename _Tp> template<typename _Tp>
inline long long inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
long long>::__type
llround(_Tp __x) llround(_Tp __x)
{ { return __builtin_llround(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return llround(__type(__x));
}
inline float inline float
log1p(float __x) log1p(float __x)
...@@ -1408,12 +1409,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1408,12 +1409,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_log1pl(__x); } { return __builtin_log1pl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
log1p(_Tp __x) log1p(_Tp __x)
{ { return __builtin_log1p(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return log1p(__type(__x));
}
// DR 568. // DR 568.
inline float inline float
...@@ -1425,12 +1424,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1425,12 +1424,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_log2l(__x); } { return __builtin_log2l(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
log2(_Tp __x) log2(_Tp __x)
{ { return __builtin_log2(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return log2(__type(__x));
}
inline float inline float
logb(float __x) logb(float __x)
...@@ -1441,12 +1438,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1441,12 +1438,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_logbl(__x); } { return __builtin_logbl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
logb(_Tp __x) logb(_Tp __x)
{ { return __builtin_logb(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return logb(__type(__x));
}
inline long inline long
lrint(float __x) lrint(float __x)
...@@ -1457,12 +1452,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1457,12 +1452,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_lrintl(__x); } { return __builtin_lrintl(__x); }
template<typename _Tp> template<typename _Tp>
inline long inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
long>::__type
lrint(_Tp __x) lrint(_Tp __x)
{ { return __builtin_lrint(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return lrint(__type(__x));
}
inline long inline long
lround(float __x) lround(float __x)
...@@ -1473,12 +1466,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1473,12 +1466,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_lroundl(__x); } { return __builtin_lroundl(__x); }
template<typename _Tp> template<typename _Tp>
inline long inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
long>::__type
lround(_Tp __x) lround(_Tp __x)
{ { return __builtin_lround(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return lround(__type(__x));
}
inline float inline float
nearbyint(float __x) nearbyint(float __x)
...@@ -1489,12 +1480,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1489,12 +1480,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_nearbyintl(__x); } { return __builtin_nearbyintl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
nearbyint(_Tp __x) nearbyint(_Tp __x)
{ { return __builtin_nearbyint(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return nearbyint(__type(__x));
}
inline float inline float
nextafter(float __x, float __y) nextafter(float __x, float __y)
...@@ -1505,7 +1494,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1505,7 +1494,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_nextafterl(__x, __y); } { return __builtin_nextafterl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
nextafter(_Tp __x, _Up __y) nextafter(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1521,12 +1514,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1521,12 +1514,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_nexttowardl(__x, __y); } { return __builtin_nexttowardl(__x, __y); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
nexttoward(_Tp __x, long double __y) nexttoward(_Tp __x, long double __y)
{ { return __builtin_nexttoward(__x, __y); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return nexttoward(__type(__x), __y);
}
inline float inline float
remainder(float __x, float __y) remainder(float __x, float __y)
...@@ -1537,7 +1528,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1537,7 +1528,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_remainderl(__x, __y); } { return __builtin_remainderl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
remainder(_Tp __x, _Up __y) remainder(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1553,7 +1548,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1553,7 +1548,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_remquol(__x, __y, __pquo); } { return __builtin_remquol(__x, __y, __pquo); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
remquo(_Tp __x, _Up __y, int* __pquo) remquo(_Tp __x, _Up __y, int* __pquo)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1569,12 +1568,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1569,12 +1568,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_rintl(__x); } { return __builtin_rintl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
rint(_Tp __x) rint(_Tp __x)
{ { return __builtin_rint(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return rint(__type(__x));
}
inline float inline float
round(float __x) round(float __x)
...@@ -1585,12 +1582,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1585,12 +1582,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_roundl(__x); } { return __builtin_roundl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
round(_Tp __x) round(_Tp __x)
{ { return __builtin_round(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return round(__type(__x));
}
inline float inline float
scalbln(float __x, long __ex) scalbln(float __x, long __ex)
...@@ -1601,12 +1596,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1601,12 +1596,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_scalblnl(__x, __ex); } { return __builtin_scalblnl(__x, __ex); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
scalbln(_Tp __x, long __ex) scalbln(_Tp __x, long __ex)
{ { return __builtin_scalbln(__x, __ex); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return scalbln(__type(__x), __ex);
}
inline float inline float
scalbn(float __x, int __ex) scalbn(float __x, int __ex)
...@@ -1617,12 +1610,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1617,12 +1610,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_scalbnl(__x, __ex); } { return __builtin_scalbnl(__x, __ex); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
scalbn(_Tp __x, int __ex) scalbn(_Tp __x, int __ex)
{ { return __builtin_scalbn(__x, __ex); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return scalbn(__type(__x), __ex);
}
inline float inline float
tgamma(float __x) tgamma(float __x)
...@@ -1633,12 +1624,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1633,12 +1624,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_tgammal(__x); } { return __builtin_tgammal(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
tgamma(_Tp __x) tgamma(_Tp __x)
{ { return __builtin_tgamma(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return tgamma(__type(__x));
}
inline float inline float
trunc(float __x) trunc(float __x)
...@@ -1649,12 +1638,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1649,12 +1638,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_truncl(__x); } { return __builtin_truncl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
trunc(_Tp __x) trunc(_Tp __x)
{ { return __builtin_trunc(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return trunc(__type(__x));
}
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
......
...@@ -429,12 +429,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -429,12 +429,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_acoshl(__x); } { return __builtin_acoshl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
acosh(_Tp __x) acosh(_Tp __x)
{ { return __builtin_acosh(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return acosh(__type(__x));
}
using std::asin; using std::asin;
...@@ -447,12 +445,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -447,12 +445,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_asinhl(__x); } { return __builtin_asinhl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
asinh(_Tp __x) asinh(_Tp __x)
{ { return __builtin_asinh(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return asinh(__type(__x));
}
using std::atan; using std::atan;
using std::atan2; using std::atan2;
...@@ -466,12 +462,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -466,12 +462,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_atanhl(__x); } { return __builtin_atanhl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
atanh(_Tp __x) atanh(_Tp __x)
{ { return __builtin_atanh(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return atanh(__type(__x));
}
inline float inline float
cbrt(float __x) cbrt(float __x)
...@@ -482,12 +476,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -482,12 +476,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_cbrtl(__x); } { return __builtin_cbrtl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
cbrt(_Tp __x) cbrt(_Tp __x)
{ { return __builtin_cbrt(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return cbrt(__type(__x));
}
using std::ceil; using std::ceil;
...@@ -500,7 +492,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -500,7 +492,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_copysignl(__x, __y); } { return __builtin_copysignl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
copysign(_Tp __x, _Up __y) copysign(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -519,12 +515,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -519,12 +515,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_erfl(__x); } { return __builtin_erfl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
erf(_Tp __x) erf(_Tp __x)
{ { return __builtin_erf(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return erf(__type(__x));
}
inline float inline float
erfc(float __x) erfc(float __x)
...@@ -535,12 +529,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -535,12 +529,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_erfcl(__x); } { return __builtin_erfcl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
erfc(_Tp __x) erfc(_Tp __x)
{ { return __builtin_erfc(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return erfc(__type(__x));
}
using std::exp; using std::exp;
...@@ -553,12 +545,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -553,12 +545,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_exp2l(__x); } { return __builtin_exp2l(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
exp2(_Tp __x) exp2(_Tp __x)
{ { return __builtin_exp2(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return exp2(__type(__x));
}
inline float inline float
expm1(float __x) expm1(float __x)
...@@ -569,12 +559,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -569,12 +559,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_expm1l(__x); } { return __builtin_expm1l(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
expm1(_Tp __x) expm1(_Tp __x)
{ { return __builtin_expm1(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return expm1(__type(__x));
}
// Note: we deal with fabs in a special way, because an using std::fabs // Note: we deal with fabs in a special way, because an using std::fabs
// would bring in also the overloads for complex types, which in C++0x // would bring in also the overloads for complex types, which in C++0x
...@@ -604,7 +592,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -604,7 +592,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fdiml(__x, __y); } { return __builtin_fdiml(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fdim(_Tp __x, _Up __y) fdim(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -622,7 +614,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -622,7 +614,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fmal(__x, __y, __z); } { return __builtin_fmal(__x, __y, __z); }
template<typename _Tp, typename _Up, typename _Vp> template<typename _Tp, typename _Up, typename _Vp>
inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type inline
typename __gnu_cxx::__promote_3<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value
&& __is_arithmetic<_Vp>::__value,
_Tp>::__type, _Up, _Vp>::__type
fma(_Tp __x, _Up __y, _Vp __z) fma(_Tp __x, _Up __y, _Vp __z)
{ {
typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type; typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
...@@ -638,7 +635,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -638,7 +635,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fmaxl(__x, __y); } { return __builtin_fmaxl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fmax(_Tp __x, _Up __y) fmax(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -654,7 +655,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -654,7 +655,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fminl(__x, __y); } { return __builtin_fminl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fmin(_Tp __x, _Up __y) fmin(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -673,11 +678,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -673,11 +678,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_hypotl(__x, __y); } { return __builtin_hypotl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
hypot(_Tp __x, _Up __y) typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
hypot(_Tp __y, _Up __x)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return hypot(__type(__x), __type(__y)); return hypot(__type(__y), __type(__x));
} }
inline int inline int
...@@ -689,12 +698,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -689,12 +698,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_ilogbl(__x); } { return __builtin_ilogbl(__x); }
template<typename _Tp> template<typename _Tp>
inline int inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
int>::__type
ilogb(_Tp __x) ilogb(_Tp __x)
{ { return __builtin_ilogb(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return ilogb(__type(__x));
}
using std::ldexp; using std::ldexp;
...@@ -707,12 +714,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -707,12 +714,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_lgammal(__x); } { return __builtin_lgammal(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
lgamma(_Tp __x) lgamma(_Tp __x)
{ { return __builtin_lgamma(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return lgamma(__type(__x));
}
inline long long inline long long
llrint(float __x) llrint(float __x)
...@@ -723,12 +728,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -723,12 +728,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_llrintl(__x); } { return __builtin_llrintl(__x); }
template<typename _Tp> template<typename _Tp>
inline long long inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
long long>::__type
llrint(_Tp __x) llrint(_Tp __x)
{ { return __builtin_llrint(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return llrint(__type(__x));
}
inline long long inline long long
llround(float __x) llround(float __x)
...@@ -739,12 +742,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -739,12 +742,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_llroundl(__x); } { return __builtin_llroundl(__x); }
template<typename _Tp> template<typename _Tp>
inline long long inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
long long>::__type
llround(_Tp __x) llround(_Tp __x)
{ { return __builtin_llround(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return llround(__type(__x));
}
using std::log; using std::log;
using std::log10; using std::log10;
...@@ -758,12 +759,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -758,12 +759,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_log1pl(__x); } { return __builtin_log1pl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
log1p(_Tp __x) log1p(_Tp __x)
{ { return __builtin_log1p(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return log1p(__type(__x));
}
// DR 568. // DR 568.
inline float inline float
...@@ -775,12 +774,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -775,12 +774,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_log2l(__x); } { return __builtin_log2l(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
log2(_Tp __x) log2(_Tp __x)
{ { return __builtin_log2(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return log2(__type(__x));
}
inline float inline float
logb(float __x) logb(float __x)
...@@ -791,11 +788,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -791,11 +788,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_logbl(__x); } { return __builtin_logbl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
logb(_Tp __x) logb(_Tp __x)
{ {
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return __builtin_logb(__x);
return logb(__type(__x));
} }
inline long inline long
...@@ -807,12 +804,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -807,12 +804,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_lrintl(__x); } { return __builtin_lrintl(__x); }
template<typename _Tp> template<typename _Tp>
inline long inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
long>::__type
lrint(_Tp __x) lrint(_Tp __x)
{ { return __builtin_lrint(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return lrint(__type(__x));
}
inline long inline long
lround(float __x) lround(float __x)
...@@ -823,12 +818,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -823,12 +818,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_lroundl(__x); } { return __builtin_lroundl(__x); }
template<typename _Tp> template<typename _Tp>
inline long inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
long>::__type
lround(_Tp __x) lround(_Tp __x)
{ { return __builtin_lround(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return lround(__type(__x));
}
inline float inline float
nearbyint(float __x) nearbyint(float __x)
...@@ -839,12 +832,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -839,12 +832,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_nearbyintl(__x); } { return __builtin_nearbyintl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
nearbyint(_Tp __x) nearbyint(_Tp __x)
{ { return __builtin_nearbyint(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return nearbyint(__type(__x));
}
inline float inline float
nextafter(float __x, float __y) nextafter(float __x, float __y)
...@@ -855,7 +846,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -855,7 +846,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_nextafterl(__x, __y); } { return __builtin_nextafterl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
nextafter(_Tp __x, _Up __y) nextafter(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -871,12 +866,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -871,12 +866,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_nexttowardl(__x, __y); } { return __builtin_nexttowardl(__x, __y); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
nexttoward(_Tp __x, long double __y) nexttoward(_Tp __x, long double __y)
{ { return __builtin_nexttoward(__x, __y); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return nexttoward(__type(__x), __y);
}
// DR 550. What should the return type of pow(float,int) be? // DR 550. What should the return type of pow(float,int) be?
// NB: C++0x and TR1 != C++03. // NB: C++0x and TR1 != C++03.
...@@ -891,7 +884,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -891,7 +884,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_remainderl(__x, __y); } { return __builtin_remainderl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
remainder(_Tp __x, _Up __y) remainder(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -907,7 +904,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -907,7 +904,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_remquol(__x, __y, __pquo); } { return __builtin_remquol(__x, __y, __pquo); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type inline
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
remquo(_Tp __x, _Up __y, int* __pquo) remquo(_Tp __x, _Up __y, int* __pquo)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -923,12 +924,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -923,12 +924,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_rintl(__x); } { return __builtin_rintl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
rint(_Tp __x) rint(_Tp __x)
{ { return __builtin_rint(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return rint(__type(__x));
}
inline float inline float
round(float __x) round(float __x)
...@@ -939,12 +938,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -939,12 +938,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_roundl(__x); } { return __builtin_roundl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
round(_Tp __x) round(_Tp __x)
{ { return __builtin_round(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return round(__type(__x));
}
inline float inline float
scalbln(float __x, long __ex) scalbln(float __x, long __ex)
...@@ -955,12 +952,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -955,12 +952,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_scalblnl(__x, __ex); } { return __builtin_scalblnl(__x, __ex); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
scalbln(_Tp __x, long __ex) scalbln(_Tp __x, long __ex)
{ { return __builtin_scalbln(__x, __ex); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return scalbln(__type(__x), __ex);
}
inline float inline float
scalbn(float __x, int __ex) scalbn(float __x, int __ex)
...@@ -971,12 +966,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -971,12 +966,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_scalbnl(__x, __ex); } { return __builtin_scalbnl(__x, __ex); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
scalbn(_Tp __x, int __ex) scalbn(_Tp __x, int __ex)
{ { return __builtin_scalbn(__x, __ex); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return scalbn(__type(__x), __ex);
}
using std::sin; using std::sin;
using std::sinh; using std::sinh;
...@@ -993,12 +986,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -993,12 +986,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_tgammal(__x); } { return __builtin_tgammal(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
tgamma(_Tp __x) tgamma(_Tp __x)
{ { return __builtin_tgamma(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return tgamma(__type(__x));
}
inline float inline float
trunc(float __x) trunc(float __x)
...@@ -1009,12 +1000,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1009,12 +1000,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_truncl(__x); } { return __builtin_truncl(__x); }
template<typename _Tp> template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
trunc(_Tp __x) trunc(_Tp __x)
{ { return __builtin_trunc(__x); }
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return trunc(__type(__x));
}
#endif #endif
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
......
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// Copyright (C) 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cmath>
// libstdc++/48933
#ifdef _GLIBCXX_USE_C99_MATH_TR1
struct Foo { };
template Foo std::atan2<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::acosh<Foo>(Foo); // { dg-error "not match" }
template Foo std::asinh<Foo>(Foo); // { dg-error "not match" }
template Foo std::atanh<Foo>(Foo); // { dg-error "not match" }
template Foo std::cbrt<Foo>(Foo); // { dg-error "not match" }
template Foo std::copysign<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::erf<Foo>(Foo); // { dg-error "not match" }
template Foo std::erfc<Foo>(Foo); // { dg-error "not match" }
template Foo std::exp2<Foo>(Foo); // { dg-error "not match" }
template Foo std::expm1<Foo>(Foo); // { dg-error "not match" }
template Foo std::fdim<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::fma<Foo, Foo, Foo>(Foo(), Foo(), Foo()); // { dg-error "not match" }
template Foo std::fmax<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::fmin<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::hypot<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template int std::ilogb<Foo>(Foo); // { dg-error "not match" }
template Foo std::lgamma<Foo>(Foo); // { dg-error "not match" }
template long long std::llrint<Foo>(Foo); // { dg-error "not match" }
template long long std::llround<Foo>(Foo); // { dg-error "not match" }
template Foo std::log1p<Foo>(Foo); // { dg-error "not match" }
template Foo std::log2<Foo>(Foo); // { dg-error "not match" }
template Foo std::logb<Foo>(Foo); // { dg-error "not match" }
template long std::lrint<Foo>(Foo); // { dg-error "not match" }
template long std::lround<Foo>(Foo); // { dg-error "not match" }
template Foo std::nearbyint<Foo>(Foo); // { dg-error "not match" }
template Foo std::nextafter<Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::nexttoward<Foo>(Foo, long double); // { dg-error "not match" }
template Foo std::remainder<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::remquo<Foo>(Foo, Foo, int*); // { dg-error "not match" }
template Foo std::rint<Foo>(Foo); // { dg-error "not match" }
template Foo std::round<Foo>(Foo); // { dg-error "not match" }
template Foo std::scalbln<Foo>(Foo, long); // { dg-error "not match" }
template Foo std::scalbn<Foo>(Foo, int); // { dg-error "not match" }
template Foo std::tgamma<Foo>(Foo); // { dg-error "not match" }
template Foo std::trunc<Foo>(Foo); // { dg-error "not match" }
#endif
// { dg-do compile }
// Copyright (C) 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.16.4 Additional overloads
#include <tr1/cmath>
// libstdc++/48933
#ifdef _GLIBCXX_USE_C99_MATH_TR1
struct Foo { };
template Foo std::tr1::atan2<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::acosh<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::asinh<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::atanh<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::cbrt<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::copysign<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::erf<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::erfc<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::exp2<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::expm1<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::fdim<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::fma<Foo, Foo, Foo>(Foo(), Foo(), Foo()); // { dg-error "not match" }
template Foo std::tr1::fmax<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::fmin<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::hypot<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template int std::tr1::ilogb<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::lgamma<Foo>(Foo); // { dg-error "not match" }
template long long std::tr1::llrint<Foo>(Foo); // { dg-error "not match" }
template long long std::tr1::llround<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::log1p<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::log2<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::logb<Foo>(Foo); // { dg-error "not match" }
template long std::tr1::lrint<Foo>(Foo); // { dg-error "not match" }
template long std::tr1::lround<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::nearbyint<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::nextafter<Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::nexttoward<Foo>(Foo, long double); // { dg-error "not match" }
template Foo std::tr1::remainder<Foo, Foo>(Foo, Foo); // { dg-error "not match" }
template Foo std::tr1::remquo<Foo>(Foo, Foo, int*); // { dg-error "not match" }
template Foo std::tr1::rint<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::round<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::scalbln<Foo>(Foo, long); // { dg-error "not match" }
template Foo std::tr1::scalbn<Foo>(Foo, int); // { dg-error "not match" }
template Foo std::tr1::tgamma<Foo>(Foo); // { dg-error "not match" }
template Foo std::tr1::trunc<Foo>(Foo); // { dg-error "not match" }
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment