summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2009-04-21 11:42:51 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2009-04-21 11:42:51 +0000
commited2807f4cd9f1beaa1b4f0deac28279e02718bb9 (patch)
treee0fcc3fc22ca93cd08ba47eed8cde8517ea95df5 /libstdc++-v3
parent2970ccb3bbd710ac4905c5b2da5cf7547210adee (diff)
downloadgcc-ed2807f4cd9f1beaa1b4f0deac28279e02718bb9.tar.gz
re PR libstdc++/39835 (Bootstrap failure: libstdc++-v3/include/bits/random.h:3630: error: expected â,â or â...â before numeric constant)
2009-04-21 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/39835 * include/bits/random.h: Avoid the badname __alpha (and, for consistency, __beta too). * include/bits/random.tcc: Likewise. From-SVN: r146516
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/include/bits/random.h12
-rw-r--r--libstdc++-v3/include/bits/random.tcc30
3 files changed, 28 insertions, 21 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index b72a0a3f80e..dcd313b3a21 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/39835
+ * include/bits/random.h: Avoid the badname __alpha (and, for
+ consistency, __beta too).
+ * include/bits/random.tcc: Likewise.
+
2009-04-19 Jan Hubicka <jh@suse.cz>
* include/c_compatibility/stdatomic.h (__atomic_flag_for_address): Use
diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h
index 366105caa8f..425420607ce 100644
--- a/libstdc++-v3/include/bits/random.h
+++ b/libstdc++-v3/include/bits/random.h
@@ -3627,9 +3627,9 @@ namespace std
friend class gamma_distribution<_RealType>;
explicit
- param_type(_RealType __alpha = _RealType(1),
- _RealType __beta = _RealType(1))
- : _M_alpha(__alpha), _M_beta(__beta)
+ param_type(_RealType __alpha_val = _RealType(1),
+ _RealType __beta_val = _RealType(1))
+ : _M_alpha(__alpha_val), _M_beta(__beta_val)
{
_GLIBCXX_DEBUG_ASSERT(_M_alpha > _RealType(0));
_M_initialize();
@@ -3660,9 +3660,9 @@ namespace std
* @f$ \alpha @f$ and @f$ \beta @f$.
*/
explicit
- gamma_distribution(_RealType __alpha = _RealType(1),
- _RealType __beta = _RealType(1))
- : _M_param(__alpha, __beta)
+ gamma_distribution(_RealType __alpha_val = _RealType(1),
+ _RealType __beta_val = _RealType(1))
+ : _M_param(__alpha_val, __beta_val)
{ }
explicit
diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc
index 9fed72ff881..8944c116b7e 100644
--- a/libstdc++-v3/include/bits/random.tcc
+++ b/libstdc++-v3/include/bits/random.tcc
@@ -1921,14 +1921,14 @@ namespace std
__aurng(__urng);
bool __reject;
- const _RealType __alpha = __param.alpha();
- const _RealType __beta = __param.beta();
- if (__alpha >= 1)
+ const _RealType __alpha_val = __param.alpha();
+ const _RealType __beta_val = __param.beta();
+ if (__alpha_val >= 1)
{
// alpha - log(4)
- const result_type __b = __alpha
+ const result_type __b = __alpha_val
- result_type(1.3862943611198906188344642429163531L);
- const result_type __c = __alpha + __param._M_l_d;
+ const result_type __c = __alpha_val + __param._M_l_d;
const result_type __1l = 1 / __param._M_l_d;
// 1 + log(9 / 2)
@@ -1936,11 +1936,11 @@ namespace std
do
{
- const result_type __u = __aurng() / __beta;
- const result_type __v = __aurng() / __beta;
+ const result_type __u = __aurng() / __beta_val;
+ const result_type __v = __aurng() / __beta_val;
const result_type __y = __1l * std::log(__v / (1 - __v));
- __x = __alpha * std::exp(__y);
+ __x = __alpha_val * std::exp(__y);
const result_type __z = __u * __v * __v;
const result_type __r = __b + __c * __y - __x;
@@ -1953,12 +1953,12 @@ namespace std
}
else
{
- const result_type __c = 1 / __alpha;
+ const result_type __c = 1 / __alpha_val;
do
{
- const result_type __z = -std::log(__aurng() / __beta);
- const result_type __e = -std::log(__aurng() / __beta);
+ const result_type __z = -std::log(__aurng() / __beta_val);
+ const result_type __e = -std::log(__aurng() / __beta_val);
__x = std::pow(__z, __c);
@@ -1967,7 +1967,7 @@ namespace std
while (__reject);
}
- return __beta * __x;
+ return __beta_val * __x;
}
template<typename _RealType, typename _CharT, typename _Traits>
@@ -2005,10 +2005,10 @@ namespace std
const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::dec | __ios_base::skipws);
- _RealType __alpha, __beta;
- __is >> __alpha >> __beta;
+ _RealType __alpha_val, __beta_val;
+ __is >> __alpha_val >> __beta_val;
__x.param(typename gamma_distribution<_RealType>::
- param_type(__alpha, __beta));
+ param_type(__alpha_val, __beta_val));
__is.flags(__flags);
return __is;