aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/bits
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include/bits')
-rw-r--r--libstdc++-v3/include/bits/basic_string.h5
-rw-r--r--libstdc++-v3/include/bits/char_traits.h4
-rw-r--r--libstdc++-v3/include/bits/node_handle.h2
-rw-r--r--libstdc++-v3/include/bits/random.tcc6
-rw-r--r--libstdc++-v3/include/bits/valarray_array.h10
5 files changed, 18 insertions, 9 deletions
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 7df39685ad3..674fe0963eb 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -5130,7 +5130,10 @@ _GLIBCXX_END_NAMESPACE_CXX11
*/
_CharT*
data() noexcept
- { return _M_data(); }
+ {
+ _M_leak();
+ return _M_data();
+ }
#endif
/**
diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h
index 3ecc30e46cb..791608ad3db 100644
--- a/libstdc++-v3/include/bits/char_traits.h
+++ b/libstdc++-v3/include/bits/char_traits.h
@@ -143,8 +143,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
};
-#define __cpp_lib_constexpr_char_traits 201611
-
template<typename _CharT>
_GLIBCXX14_CONSTEXPR int
char_traits<_CharT>::
@@ -217,6 +215,8 @@ namespace std _GLIBCXX_VISIBILITY(default)
_GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus > 201402
+#define __cpp_lib_constexpr_char_traits 201611
+
/**
* @brief Determine whether the characters of a NULL-terminated
* string are known at compile time.
diff --git a/libstdc++-v3/include/bits/node_handle.h b/libstdc++-v3/include/bits/node_handle.h
index f75f7425f47..b4f732a36f0 100644
--- a/libstdc++-v3/include/bits/node_handle.h
+++ b/libstdc++-v3/include/bits/node_handle.h
@@ -105,7 +105,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
using std::swap;
swap(_M_ptr, __nh._M_ptr);
- if (_AllocTraits::propagate_on_container_swap
+ if (_AllocTraits::propagate_on_container_swap::value
|| !_M_alloc || !__nh._M_alloc)
_M_alloc.swap(__nh._M_alloc);
else
diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc
index df05ebea6e9..c43d85551c3 100644
--- a/libstdc++-v3/include/bits/random.tcc
+++ b/libstdc++-v3/include/bits/random.tcc
@@ -2356,7 +2356,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__v = __v * __v * __v;
__u = __aurng();
}
- while (__u > result_type(1.0) - 0.331 * __n * __n * __n * __n
+ while (__u > result_type(1.0) - 0.0331 * __n * __n * __n * __n
&& (std::log(__u) > (0.5 * __n * __n + __a1
* (1.0 - __v + std::log(__v)))));
@@ -2405,7 +2405,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__v = __v * __v * __v;
__u = __aurng();
}
- while (__u > result_type(1.0) - 0.331 * __n * __n * __n * __n
+ while (__u > result_type(1.0) - 0.0331 * __n * __n * __n * __n
&& (std::log(__u) > (0.5 * __n * __n + __a1
* (1.0 - __v + std::log(__v)))));
@@ -2426,7 +2426,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__v = __v * __v * __v;
__u = __aurng();
}
- while (__u > result_type(1.0) - 0.331 * __n * __n * __n * __n
+ while (__u > result_type(1.0) - 0.0331 * __n * __n * __n * __n
&& (std::log(__u) > (0.5 * __n * __n + __a1
* (1.0 - __v + std::log(__v)))));
diff --git a/libstdc++-v3/include/bits/valarray_array.h b/libstdc++-v3/include/bits/valarray_array.h
index f169edd9728..bb32d7ac188 100644
--- a/libstdc++-v3/include/bits/valarray_array.h
+++ b/libstdc++-v3/include/bits/valarray_array.h
@@ -152,7 +152,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
inline static void
_S_do_it(const _Tp* __b, const _Tp* __e, _Tp* __restrict__ __o)
- { __builtin_memcpy(__o, __b, (__e - __b) * sizeof(_Tp)); }
+ {
+ if (__b)
+ __builtin_memcpy(__o, __b, (__e - __b) * sizeof(_Tp));
+ }
};
template<typename _Tp>
@@ -258,7 +261,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
inline static void
_S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
- { __builtin_memcpy(__b, __a, __n * sizeof (_Tp)); }
+ {
+ if (__n != 0)
+ __builtin_memcpy(__b, __a, __n * sizeof (_Tp));
+ }
};
// Copy a plain array __a[<__n>] into a play array __b[<>]