diff options
author | Edward Smith-Rowland <3dw4rd@verizon.net> | 2017-08-12 19:09:40 +0000 |
---|---|---|
committer | Edward Smith-Rowland <3dw4rd@verizon.net> | 2017-08-12 19:09:40 +0000 |
commit | 40fa8ee5f9da161462fde48776ef6262366f9a13 (patch) | |
tree | d3c3bf913950c59ef83b8d9ede50b0978ec0c12f /libstdc++-v3/include/std | |
parent | 3acaf2e51caf356a9afc763cfd70b91d1ab094b5 (diff) |
Merged revisions r232323 through r251067 to the branchtr29124
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tr29124@251068 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std')
-rw-r--r-- | libstdc++-v3/include/std/chrono | 25 | ||||
-rw-r--r-- | libstdc++-v3/include/std/complex | 376 | ||||
-rw-r--r-- | libstdc++-v3/include/std/functional | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/std/istream | 12 | ||||
-rw-r--r-- | libstdc++-v3/include/std/numeric | 10 | ||||
-rw-r--r-- | libstdc++-v3/include/std/streambuf | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/std/string_view | 11 | ||||
-rw-r--r-- | libstdc++-v3/include/std/thread | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/std/type_traits | 18 | ||||
-rw-r--r-- | libstdc++-v3/include/std/variant | 105 |
10 files changed, 83 insertions, 494 deletions
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono index c3a6ba8f873..1bcbf524a7b 100644 --- a/libstdc++-v3/include/std/chrono +++ b/libstdc++-v3/include/std/chrono @@ -45,6 +45,8 @@ namespace std _GLIBCXX_VISIBILITY(default) { +_GLIBCXX_BEGIN_NAMESPACE_VERSION + /** * @defgroup chrono Time * @ingroup utilities @@ -58,19 +60,13 @@ namespace std _GLIBCXX_VISIBILITY(default) */ namespace chrono { - _GLIBCXX_BEGIN_NAMESPACE_VERSION - template<typename _Rep, typename _Period = ratio<1>> struct duration; template<typename _Clock, typename _Dur = typename _Clock::duration> struct time_point; - - _GLIBCXX_END_NAMESPACE_VERSION } -_GLIBCXX_BEGIN_NAMESPACE_VERSION - // 20.11.4.3 specialization of common_type (for duration, sfinae-friendly) template<typename _CT, typename _Period1, typename _Period2> @@ -117,12 +113,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION common_type<_Duration1, _Duration2>>::type, _Clock>::type { }; -_GLIBCXX_END_NAMESPACE_VERSION - namespace chrono { - _GLIBCXX_BEGIN_NAMESPACE_VERSION - // Primary template for duration_cast impl. template<typename _ToDur, typename _CF, typename _CR, bool _NumIsOne = false, bool _DenIsOne = false> @@ -871,8 +863,6 @@ _GLIBCXX_END_NAMESPACE_VERSION using high_resolution_clock = system_clock; } // end inline namespace _V2 - - _GLIBCXX_END_NAMESPACE_VERSION } // namespace chrono #if __cplusplus > 201103L @@ -883,8 +873,6 @@ _GLIBCXX_END_NAMESPACE_VERSION { inline namespace chrono_literals { - _GLIBCXX_BEGIN_NAMESPACE_VERSION - template<typename _Rep, unsigned long long _Val> struct _Checked_integral_constant : integral_constant<_Rep, static_cast<_Rep>(_Val)> @@ -959,22 +947,19 @@ _GLIBCXX_END_NAMESPACE_VERSION operator""ns() { return __check_overflow<chrono::nanoseconds, _Digits...>(); } - _GLIBCXX_END_NAMESPACE_VERSION } // inline namespace chrono_literals } // inline namespace literals namespace chrono { - _GLIBCXX_BEGIN_NAMESPACE_VERSION - - using namespace literals::chrono_literals; - - _GLIBCXX_END_NAMESPACE_VERSION + using namespace literals::chrono_literals; } // namespace chrono #endif // __cplusplus > 201103L // @} group chrono + +_GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif //_GLIBCXX_USE_C99_STDINT_TR1 diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex index d2aa172fc95..11c714e59ce 100644 --- a/libstdc++-v3/include/std/complex +++ b/libstdc++-v3/include/std/complex @@ -45,9 +45,10 @@ # include <cmath> #undef _GLIBCXX_NO_SPECFUN #include <sstream> + #if _GLIBCXX_HAVE_FLOAT128_MATH -#include <bits/float128_io.h> -#endif +# include <bits/complex128_math.h> +#endif // _GLIBCXX_HAVE_FLOAT128_MATH // Get rid of a macro possibly defined in <complex.h> #undef complex @@ -571,42 +572,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __z.imag(); } #endif -#if _GLIBCXX_HAVE_FLOAT128_MATH - typedef _Complex float __attribute__((mode(TC))) __complex128; -#ifdef __cplusplus -extern "C" { -#endif - __float128 strtoflt128 (const char*, char**) _GLIBCXX_NOEXCEPT; - - __float128 cabsq (__complex128) _GLIBCXX_NOEXCEPT; - __float128 cargq (__complex128) _GLIBCXX_NOEXCEPT; - __float128 cimagq (__complex128) _GLIBCXX_NOEXCEPT; - __float128 crealq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 cacosq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 cacoshq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 casinq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 casinhq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 catanq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 catanhq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 ccosq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 ccoshq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 cexpq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 cexpiq (__float128) _GLIBCXX_NOEXCEPT; - __complex128 clogq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 clog10q (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 conjq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 cpowq (__complex128, __complex128) _GLIBCXX_NOEXCEPT; - __complex128 cprojq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 csinq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 csinhq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 csqrtq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 ctanq (__complex128) _GLIBCXX_NOEXCEPT; - __complex128 ctanhq (__complex128) _GLIBCXX_NOEXCEPT; -#ifdef __cplusplus -} -#endif -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - // 26.2.7/3 abs(__z): Returns the magnitude of __z. template<typename _Tp> inline _Tp @@ -633,12 +598,6 @@ extern "C" { __complex_abs(const __complex__ long double& __z) { return __builtin_cabsl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __float128 - __complex_abs(const __complex128& __z) - { return cabsq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline _Tp abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); } @@ -666,12 +625,6 @@ extern "C" { __complex_arg(const __complex__ long double& __z) { return __builtin_cargl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __float128 - __complex_arg(const __complex128& __z) - { return cargq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline _Tp arg(const complex<_Tp>& __z) { return __complex_arg(__z.__rep()); } @@ -753,12 +706,6 @@ extern "C" { __complex_cos(const __complex__ long double& __z) { return __builtin_ccosl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_cos(const __complex128& __z) - { return ccosq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline complex<_Tp> cos(const complex<_Tp>& __z) { return __complex_cos(__z.__rep()); } @@ -789,12 +736,6 @@ extern "C" { __complex_cosh(const __complex__ long double& __z) { return __builtin_ccoshl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_cosh(const __complex128& __z) - { return ccoshq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline complex<_Tp> cosh(const complex<_Tp>& __z) { return __complex_cosh(__z.__rep()); } @@ -821,12 +762,6 @@ extern "C" { __complex_exp(const __complex__ long double& __z) { return __builtin_cexpl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_exp(const __complex128& __z) - { return cexpq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline complex<_Tp> exp(const complex<_Tp>& __z) { return __complex_exp(__z.__rep()); } @@ -854,12 +789,6 @@ extern "C" { __complex_log(const __complex__ long double& __z) { return __builtin_clogl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_log(const __complex128& __z) - { return clogq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline complex<_Tp> log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); } @@ -895,12 +824,6 @@ extern "C" { __complex_sin(const __complex__ long double& __z) { return __builtin_csinl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_sin(const __complex128& __z) - { return csinq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline complex<_Tp> sin(const complex<_Tp>& __z) { return __complex_sin(__z.__rep()); } @@ -931,12 +854,6 @@ extern "C" { __complex_sinh(const __complex__ long double& __z) { return __builtin_csinhl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_sinh(const __complex128& __z) - { return csinhq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline complex<_Tp> sinh(const complex<_Tp>& __z) { return __complex_sinh(__z.__rep()); } @@ -981,12 +898,6 @@ extern "C" { __complex_sqrt(const __complex__ long double& __z) { return __builtin_csqrtl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_sqrt(const __complex128& __z) - { return csqrtq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline complex<_Tp> sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z.__rep()); } @@ -1014,12 +925,6 @@ extern "C" { __complex_tan(const __complex__ long double& __z) { return __builtin_ctanl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_tan(const __complex128& __z) - { return ctanq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline complex<_Tp> tan(const complex<_Tp>& __z) { return __complex_tan(__z.__rep()); } @@ -1048,12 +953,6 @@ extern "C" { __complex_tanh(const __complex__ long double& __z) { return __builtin_ctanhl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_tanh(const __complex128& __z) - { return ctanhq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline complex<_Tp> tanh(const complex<_Tp>& __z) { return __complex_tanh(__z.__rep()); } @@ -1132,12 +1031,6 @@ extern "C" { const __complex__ long double& __y) { return __builtin_cpowl(__x, __y); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_pow(const __complex128& __x, const __complex128& __y) - { return cpowq(__x, __y); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline complex<_Tp> pow(const complex<_Tp>& __x, const complex<_Tp>& __y) @@ -1619,189 +1512,6 @@ extern "C" { _ComplexT _M_value; }; -#if _GLIBCXX_HAVE_FLOAT128_MATH - - /// complex<__float128> specialization - template<> - struct complex<__float128> - { - typedef __float128 value_type; - - // From quadmath.h - //typedef _Complex float __attribute__((mode(TC))) __complex128; - typedef __complex128 _ComplexT; - - _GLIBCXX_CONSTEXPR - complex(_ComplexT __z) - : _M_value(__z) - { } - - _GLIBCXX_CONSTEXPR - complex(__float128 __r = 0.0Q, - __float128 __i = 0.0Q) -#if __cplusplus >= 201103L - : _M_value{ __r, __i } - { } -#else - { - __real__ _M_value = __r; - __imag__ _M_value = __i; - } -#endif - - _GLIBCXX_CONSTEXPR - complex(const complex<float>& __z) - : _M_value(__z.__rep()) - { } - - _GLIBCXX_CONSTEXPR - complex(const complex<double>& __z) - : _M_value(__z.__rep()) - { } - - _GLIBCXX_CONSTEXPR - complex(const complex<long double>& __z) - : _M_value(__z.__rep()) - { } - -#if __cplusplus >= 201103L - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR 387. std::complex over-encapsulated. - __attribute ((__abi_tag__ ("cxx11"))) - constexpr __float128 - real() const - { return __real__ _M_value; } - - __attribute ((__abi_tag__ ("cxx11"))) - constexpr __float128 - imag() const - { return __imag__ _M_value; } -#else - __float128& - real() - { return __real__ _M_value; } - - const __float128& - real() const - { return __real__ _M_value; } - - __float128& - imag() - { return __imag__ _M_value; } - - const __float128& - imag() - const { return __imag__ _M_value; } -#endif - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR 387. std::complex over-encapsulated. - void - real(__float128 __val) - { __real__ _M_value = __val; } - - void - imag(__float128 __val) - { __imag__ _M_value = __val; } - - complex& - operator=(__float128 __r) - { - _M_value = __r; - return *this; - } - - complex& - operator+=(__float128 __r) - { - _M_value += __r; - return *this; - } - - complex& - operator-=(__float128 __r) - { - _M_value -= __r; - return *this; - } - - complex& - operator*=(__float128 __r) - { - _M_value *= __r; - return *this; - } - - complex& - operator/=(__float128 __r) - { - _M_value /= __r; - return *this; - } - - // The compiler knows how to do this efficiently - // complex& operator=(const complex&); - - template<typename _Tp> - complex& - operator=(const complex<_Tp>& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - return *this; - } - - template<typename _Tp> - complex& - operator+=(const complex<_Tp>& __z) - { - __real__ _M_value += __z.real(); - __imag__ _M_value += __z.imag(); - return *this; - } - - template<typename _Tp> - complex& - operator-=(const complex<_Tp>& __z) - { - __real__ _M_value -= __z.real(); - __imag__ _M_value -= __z.imag(); - return *this; - } - - template<typename _Tp> - complex& - operator*=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value *= __t; - return *this; - } - - template<typename _Tp> - complex& - operator/=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value /= __t; - return *this; - } - - _GLIBCXX_CONSTEXPR _ComplexT - __rep() const - { return _M_value; } - - private: - - _ComplexT _M_value; - }; - -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - // These bits have to be at the end of this file, so that the // specializations have all been defined. inline _GLIBCXX_CONSTEXPR @@ -1816,20 +1526,6 @@ extern "C" { complex<double>::complex(const complex<long double>& __z) : _M_value(__z.__rep()) { } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline _GLIBCXX_CONSTEXPR - complex<float>::complex(const complex<__float128>& __z) - : _M_value(__z.__rep()) { } - - inline _GLIBCXX_CONSTEXPR - complex<double>::complex(const complex<__float128>& __z) - : _M_value(__z.__rep()) { } - - inline _GLIBCXX_CONSTEXPR - complex<long double>::complex(const complex<__float128>& __z) - : _M_value(__z.__rep()) { } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. @@ -1840,10 +1536,6 @@ extern "C" { extern template ostream& operator<<(ostream&, const complex<double>&); extern template istream& operator>>(istream&, complex<long double>&); extern template ostream& operator<<(ostream&, const complex<long double>&); -#if _GLIBCXX_HAVE_FLOAT128_MATH - template istream& operator>>(istream&, complex<__float128>&); - template ostream& operator<<(ostream&, const complex<__float128>&); -#endif // _GLIBCXX_HAVE_FLOAT128_MATH #ifdef _GLIBCXX_USE_WCHAR_T extern template wistream& operator>>(wistream&, complex<float>&); @@ -1928,12 +1620,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __complex_acos(const __complex__ long double& __z) { return __builtin_cacosl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_acos(const __complex128& __z) - { return cacosq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline std::complex<_Tp> acos(const std::complex<_Tp>& __z) @@ -1970,12 +1656,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __complex_asin(const __complex__ long double& __z) { return __builtin_casinl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_asin(const __complex128& __z) - { return casinq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline std::complex<_Tp> asin(const std::complex<_Tp>& __z) @@ -2020,12 +1700,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __complex_atan(const __complex__ long double& __z) { return __builtin_catanl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_atan(const __complex128& __z) - { return catanq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline std::complex<_Tp> atan(const std::complex<_Tp>& __z) @@ -2062,12 +1736,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __complex_acosh(const __complex__ long double& __z) { return __builtin_cacoshl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_acosh(const __complex128& __z) - { return cacoshq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline std::complex<_Tp> acosh(const std::complex<_Tp>& __z) @@ -2107,12 +1775,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __complex_asinh(const __complex__ long double& __z) { return __builtin_casinhl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_asinh(const __complex128& __z) - { return casinhq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline std::complex<_Tp> asinh(const std::complex<_Tp>& __z) @@ -2157,12 +1819,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __complex_atanh(const __complex__ long double& __z) { return __builtin_catanhl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_atanh(const __complex128& __z) - { return catanhq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline std::complex<_Tp> atanh(const std::complex<_Tp>& __z) @@ -2270,12 +1926,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __complex_proj(const __complex__ long double& __z) { return __builtin_cprojl(__z); } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline __complex128 - __complex_proj(const __complex128& __z) - { return cprojq(__z); } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - template<typename _Tp> inline std::complex<_Tp> proj(const std::complex<_Tp>& __z) @@ -2303,14 +1953,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return std::complex<__type>(__x, -__type()); } -_GLIBCXX_END_NAMESPACE_VERSION - #if __cplusplus > 201103L inline namespace literals { inline namespace complex_literals { -_GLIBCXX_BEGIN_NAMESPACE_VERSION - #define __cpp_lib_complex_udls 201309 constexpr std::complex<float> @@ -2337,24 +1983,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator""il(unsigned long long __num) { return std::complex<long double>{0.0L, static_cast<long double>(__num)}; } -#if _GLIBCXX_HAVE_FLOAT128_MATH - inline std::complex<__float128> - operator""iq(const char* __str) - { return complex<__float128>(0.0Q, strtoflt128(__str, 0)); } - - constexpr std::complex<__float128> - operator""iq(unsigned long long __num) - { return std::complex<__float128>{0.0L, static_cast<__float128>(__num)}; } -#endif // _GLIBCXX_HAVE_FLOAT128_MATH - -_GLIBCXX_END_NAMESPACE_VERSION } // inline namespace complex_literals } // inline namespace literals #endif // C++14 +_GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // C++11 +#if _GLIBCXX_HAVE_FLOAT128_MATH +# include <bits/complex128.h> +#endif // _GLIBCXX_HAVE_FLOAT128_MATH + #endif /* _GLIBCXX_COMPLEX */ diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional index 465b3ec7792..a6d121bb150 100644 --- a/libstdc++-v3/include/std/functional +++ b/libstdc++-v3/include/std/functional @@ -259,15 +259,12 @@ _GLIBCXX_MEM_FN_TRAITS(&& noexcept, false_type, true_type) */ template<int _Num> struct _Placeholder { }; - _GLIBCXX_END_NAMESPACE_VERSION - /** @namespace std::placeholders * @brief ISO C++11 entities sub-namespace for functional. * @ingroup binders */ namespace placeholders { - _GLIBCXX_BEGIN_NAMESPACE_VERSION /* Define a large number of placeholders. There is no way to * simplify this with variadic templates, because we're introducing * unique names for each. @@ -301,11 +298,8 @@ _GLIBCXX_MEM_FN_TRAITS(&& noexcept, false_type, true_type) extern const _Placeholder<27> _27; extern const _Placeholder<28> _28; extern const _Placeholder<29> _29; - _GLIBCXX_END_NAMESPACE_VERSION } - _GLIBCXX_BEGIN_NAMESPACE_VERSION - /** * Partial specialization of is_placeholder that provides the placeholder * number for the placeholder objects defined by libstdc++. diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream index 1fa25555771..233cc6b0145 100644 --- a/libstdc++-v3/include/std/istream +++ b/libstdc++-v3/include/std/istream @@ -150,9 +150,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * whatever data is appropriate for the type of the argument. * * If an exception is thrown during extraction, ios_base::badbit - * will be turned on in the stream's error state without causing an - * ios_base::failure to be thrown. The original exception will then - * be rethrown. + * will be turned on in the stream's error state (without causing an + * ios_base::failure to be thrown) and the original exception will + * be rethrown if badbit is set in the exceptions mask. */ //@{ @@ -286,9 +286,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * by gcount(). * * If an exception is thrown during extraction, ios_base::badbit - * will be turned on in the stream's error state without causing an - * ios_base::failure to be thrown. The original exception will then - * be rethrown. + * will be turned on in the stream's error state (without causing an + * ios_base::failure to be thrown) and the original exception will + * be rethrown if badbit is set in the exceptions mask. */ /** diff --git a/libstdc++-v3/include/std/numeric b/libstdc++-v3/include/std/numeric index c7abbc1b681..17d629db81d 100644 --- a/libstdc++-v3/include/std/numeric +++ b/libstdc++-v3/include/std/numeric @@ -79,10 +79,10 @@ namespace std _GLIBCXX_VISIBILITY(default) { -namespace __detail -{ _GLIBCXX_BEGIN_NAMESPACE_VERSION +namespace __detail +{ // std::abs is not constexpr and doesn't support unsigned integers. template<typename _Tp> constexpr @@ -117,11 +117,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * __detail::__abs_integral(__n) : 0; } - -_GLIBCXX_END_NAMESPACE_VERSION -} - -_GLIBCXX_BEGIN_NAMESPACE_VERSION +} // namespace __detail #if __cplusplus > 201402L diff --git a/libstdc++-v3/include/std/streambuf b/libstdc++-v3/include/std/streambuf index 862c4fdbe6d..a05b46e8199 100644 --- a/libstdc++-v3/include/std/streambuf +++ b/libstdc++-v3/include/std/streambuf @@ -768,8 +768,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION overflow(int_type __c = traits_type::eof()) { return traits_type::eof(); } -#if _GLIBCXX_USE_DEPRECATED - // Annex D.6 +#if _GLIBCXX_USE_DEPRECATED && __cplusplus <= 201402L + // Annex D.6 (removed in C++17) public: /** * @brief Tosses a character. @@ -779,6 +779,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * See http://gcc.gnu.org/ml/libstdc++/2002-05/msg00168.html */ +#if __cplusplus >= 201103L + [[__deprecated__("stossc is deprecated, use sbumpc instead")]] +#endif void stossc() { diff --git a/libstdc++-v3/include/std/string_view b/libstdc++-v3/include/std/string_view index 311d6d725b3..88a7686618c 100644 --- a/libstdc++-v3/include/std/string_view +++ b/libstdc++-v3/include/std/string_view @@ -427,23 +427,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION size_t _M_len; const _CharT* _M_str; }; -_GLIBCXX_END_NAMESPACE_VERSION // [string.view.comparison], non-member basic_string_view comparison function namespace __detail { -_GLIBCXX_BEGIN_NAMESPACE_VERSION // Identity transform to create a non-deduced context, so that only one // argument participates in template argument deduction and the other // argument gets implicitly converted to the deduced type. See n3766.html. template<typename _Tp> using __idt = common_type_t<_Tp>; -_GLIBCXX_END_NAMESPACE_VERSION } -_GLIBCXX_BEGIN_NAMESPACE_VERSION - template<typename _CharT, typename _Traits> inline bool operator==(basic_string_view<_CharT, _Traits> __x, @@ -634,14 +629,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_fast_hash<hash<u32string_view>> : std::false_type { }; #endif -_GLIBCXX_END_NAMESPACE_VERSION inline namespace literals { inline namespace string_view_literals { -_GLIBCXX_BEGIN_NAMESPACE_VERSION - inline constexpr basic_string_view<char> operator""sv(const char* __str, size_t __len) { return basic_string_view<char>{__str, __len}; } @@ -661,11 +653,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator""sv(const char32_t* __str, size_t __len) { return basic_string_view<char32_t>{__str, __len}; } #endif - -_GLIBCXX_END_NAMESPACE_VERSION } // namespace string_literals } // namespace literals +_GLIBCXX_END_NAMESPACE_VERSION } // namespace std #include <bits/string_view.tcc> diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread index 8e2cb68e295..17db5ce87ae 100644 --- a/libstdc++-v3/include/std/thread +++ b/libstdc++-v3/include/std/thread @@ -321,16 +321,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __out << __id._M_thread; } -_GLIBCXX_END_NAMESPACE_VERSION - /** @namespace std::this_thread * @brief ISO C++ 2011 entities sub-namespace for thread. * 30.3.2 Namespace this_thread. */ namespace this_thread { - _GLIBCXX_BEGIN_NAMESPACE_VERSION - /// get_id inline thread::id get_id() noexcept @@ -398,12 +394,11 @@ _GLIBCXX_END_NAMESPACE_VERSION __now = _Clock::now(); } } - - _GLIBCXX_END_NAMESPACE_VERSION } // @} group threads +_GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 390b6f40af5..f021c42396c 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2873,14 +2873,16 @@ template <typename _Base, typename _Derived> template <typename _From, typename _To> inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value; -#ifdef __has_builtin -# if !__has_builtin(__has_unique_object_representations) -// Try not to break non-GNU compilers that don't support the built-in: -# define _GLIBCXX_NO_BUILTIN_HAS_UNIQ_OBJ_REP 1 +#if __GNUC__ >= 7 +# define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1 +#elif defined(__is_identifier) +// For non-GNU compilers: +# if ! __is_identifier(__has_unique_object_representations) +# define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1 # endif #endif -#ifndef _GLIBCXX_NO_BUILTIN_HAS_UNIQ_OBJ_REP +#ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP # define __cpp_lib_has_unique_object_representations 201606 /// has_unique_object_representations template<typename _Tp> @@ -2890,13 +2892,13 @@ template <typename _From, typename _To> )> { }; #endif -#undef _GLIBCXX_NO_BUILTIN_HAS_UNIQ_OBJ_REP +#undef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP #if __GNUC__ >= 7 # define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1 -#elif defined __has_builtin +#elif defined(__is_identifier) // For non-GNU compilers: -# if __has_builtin(__is_aggregate) +# if ! __is_identifier(__is_aggregate) # define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1 # endif #endif diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant index 23db6d27529..d0c22e35d0f 100644 --- a/libstdc++-v3/include/std/variant +++ b/libstdc++-v3/include/std/variant @@ -50,12 +50,12 @@ namespace std _GLIBCXX_VISIBILITY(default) { +_GLIBCXX_BEGIN_NAMESPACE_VERSION + namespace __detail { namespace __variant { -_GLIBCXX_BEGIN_NAMESPACE_VERSION - template<size_t _Np, typename... _Types> struct _Nth_type; @@ -67,12 +67,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct _Nth_type<0, _First, _Rest...> { using type = _First; }; -_GLIBCXX_END_NAMESPACE_VERSION } // namespace __variant } // namespace __detail -_GLIBCXX_BEGIN_NAMESPACE_VERSION - template<typename... _Types> class tuple; template<typename... _Types> class variant; template <typename> struct hash; @@ -141,13 +138,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr variant_alternative_t<_Np, variant<_Types...>> const&& get(const variant<_Types...>&&); -_GLIBCXX_END_NAMESPACE_VERSION - namespace __detail { namespace __variant { -_GLIBCXX_BEGIN_NAMESPACE_VERSION // Returns the first apparence of _Tp in _Types. // Returns sizeof...(_Types) if _Tp is not in _Types. template<typename _Tp, typename... _Types> @@ -299,40 +293,40 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct _Traits { static constexpr bool _S_default_ctor = - is_default_constructible_v<typename _Nth_type<0, _Types...>::type>; + is_default_constructible_v<typename _Nth_type<0, _Types...>::type>; static constexpr bool _S_copy_ctor = - (is_copy_constructible_v<_Types> && ...); + (is_copy_constructible_v<_Types> && ...); static constexpr bool _S_move_ctor = - (is_move_constructible_v<_Types> && ...); + (is_move_constructible_v<_Types> && ...); static constexpr bool _S_copy_assign = - _S_copy_ctor && _S_move_ctor - && (is_copy_assignable_v<_Types> && ...); + _S_copy_ctor && _S_move_ctor + && (is_copy_assignable_v<_Types> && ...); static constexpr bool _S_move_assign = - _S_move_ctor - && (is_move_assignable_v<_Types> && ...); + _S_move_ctor + && (is_move_assignable_v<_Types> && ...); static constexpr bool _S_trivial_dtor = - (is_trivially_destructible_v<_Types> && ...); + (is_trivially_destructible_v<_Types> && ...); static constexpr bool _S_trivial_copy_ctor = - (is_trivially_copy_constructible_v<_Types> && ...); + (is_trivially_copy_constructible_v<_Types> && ...); static constexpr bool _S_trivial_move_ctor = - (is_trivially_move_constructible_v<_Types> && ...); + (is_trivially_move_constructible_v<_Types> && ...); static constexpr bool _S_trivial_copy_assign = - _S_trivial_dtor && (is_trivially_copy_assignable_v<_Types> && ...); + _S_trivial_dtor && (is_trivially_copy_assignable_v<_Types> && ...); static constexpr bool _S_trivial_move_assign = - _S_trivial_dtor && (is_trivially_move_assignable_v<_Types> && ...); + _S_trivial_dtor && (is_trivially_move_assignable_v<_Types> && ...); // The following nothrow traits are for non-trivial SMFs. Trivial SMFs // are always nothrow. static constexpr bool _S_nothrow_default_ctor = - is_nothrow_default_constructible_v< - typename _Nth_type<0, _Types...>::type>; + is_nothrow_default_constructible_v< + typename _Nth_type<0, _Types...>::type>; static constexpr bool _S_nothrow_copy_ctor = false; static constexpr bool _S_nothrow_move_ctor = - (is_nothrow_move_constructible_v<_Types> && ...); + (is_nothrow_move_constructible_v<_Types> && ...); static constexpr bool _S_nothrow_copy_assign = false; static constexpr bool _S_nothrow_move_assign = - _S_nothrow_move_ctor && (is_nothrow_move_assignable_v<_Types> && ...); + _S_nothrow_move_ctor && (is_nothrow_move_assignable_v<_Types> && ...); }; // Defines members and ctors. @@ -452,7 +446,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename... _Types> using _Variant_storage_alias = - _Variant_storage<_Traits<_Types...>::_S_trivial_dtor, _Types...>; + _Variant_storage<_Traits<_Types...>::_S_trivial_dtor, _Types...>; // The following are (Copy|Move) (ctor|assign) layers for forwarding // triviality and handling non-trivial SMF behaviors. @@ -464,7 +458,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using _Base::_Base; _Copy_ctor_base(const _Copy_ctor_base& __rhs) - noexcept(_Traits<_Types...>::_S_nothrow_copy_ctor) + noexcept(_Traits<_Types...>::_S_nothrow_copy_ctor) { if (__rhs._M_valid()) { @@ -489,7 +483,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename... _Types> using _Copy_ctor_alias = - _Copy_ctor_base<_Traits<_Types...>::_S_trivial_copy_ctor, _Types...>; + _Copy_ctor_base<_Traits<_Types...>::_S_trivial_copy_ctor, _Types...>; template<bool, typename... _Types> struct _Move_ctor_base : _Copy_ctor_alias<_Types...> @@ -498,7 +492,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using _Base::_Base; _Move_ctor_base(_Move_ctor_base&& __rhs) - noexcept(_Traits<_Types...>::_S_nothrow_move_ctor) + noexcept(_Traits<_Types...>::_S_nothrow_move_ctor) { if (__rhs._M_valid()) { @@ -523,7 +517,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename... _Types> using _Move_ctor_alias = - _Move_ctor_base<_Traits<_Types...>::_S_trivial_move_ctor, _Types...>; + _Move_ctor_base<_Traits<_Types...>::_S_trivial_move_ctor, _Types...>; template<bool, typename... _Types> struct _Copy_assign_base : _Move_ctor_alias<_Types...> @@ -533,7 +527,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Copy_assign_base& operator=(const _Copy_assign_base& __rhs) - noexcept(_Traits<_Types...>::_S_nothrow_copy_assign) + noexcept(_Traits<_Types...>::_S_nothrow_copy_assign) { if (this->_M_index == __rhs._M_index) { @@ -576,8 +570,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename... _Types> using _Copy_assign_alias = - _Copy_assign_base<_Traits<_Types...>::_S_trivial_copy_assign, - _Types...>; + _Copy_assign_base<_Traits<_Types...>::_S_trivial_copy_assign, + _Types...>; template<bool, typename... _Types> struct _Move_assign_base : _Copy_assign_alias<_Types...> @@ -601,7 +595,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Move_assign_base& operator=(_Move_assign_base&& __rhs) - noexcept(_Traits<_Types...>::_S_nothrow_move_assign) + noexcept(_Traits<_Types...>::_S_nothrow_move_assign) { if (this->_M_index == __rhs._M_index) { @@ -644,8 +638,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename... _Types> using _Move_assign_alias = - _Move_assign_base<_Traits<_Types...>::_S_trivial_move_assign, - _Types...>; + _Move_assign_base<_Traits<_Types...>::_S_trivial_move_assign, + _Types...>; template<typename... _Types> struct _Variant_base : _Move_assign_alias<_Types...> @@ -654,7 +648,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr _Variant_base() - noexcept(_Traits<_Types...>::_S_nothrow_default_ctor) + noexcept(_Traits<_Types...>::_S_nothrow_default_ctor) : _Variant_base(in_place_index<0>) { } template<size_t _Np, typename... _Args> @@ -879,12 +873,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::index_sequence<__indices...>> : _Base_dedup<__indices, __poison_hash<remove_const_t<_Types>>>... { }; -_GLIBCXX_END_NAMESPACE_VERSION } // namespace __variant } // namespace __detail -_GLIBCXX_BEGIN_NAMESPACE_VERSION - template<typename _Tp, typename... _Types> inline constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept @@ -1041,13 +1032,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION class variant : private __detail::__variant::_Variant_base<_Types...>, private _Enable_default_constructor< - __detail::__variant::_Traits<_Types...>::_S_default_ctor, + __detail::__variant::_Traits<_Types...>::_S_default_ctor, variant<_Types...>>, private _Enable_copy_move< - __detail::__variant::_Traits<_Types...>::_S_copy_ctor, - __detail::__variant::_Traits<_Types...>::_S_copy_assign, - __detail::__variant::_Traits<_Types...>::_S_move_ctor, - __detail::__variant::_Traits<_Types...>::_S_move_assign, + __detail::__variant::_Traits<_Types...>::_S_copy_ctor, + __detail::__variant::_Traits<_Types...>::_S_copy_assign, + __detail::__variant::_Traits<_Types...>::_S_move_ctor, + __detail::__variant::_Traits<_Types...>::_S_move_assign, variant<_Types...>> { private: @@ -1060,9 +1051,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using _Base = __detail::__variant::_Variant_base<_Types...>; using _Default_ctor_enabler = - _Enable_default_constructor< - __detail::__variant::_Traits<_Types...>::_S_default_ctor, - variant<_Types...>>; + _Enable_default_constructor< + __detail::__variant::_Traits<_Types...>::_S_default_ctor, + variant<_Types...>>; template<typename _Tp> static constexpr bool @@ -1108,7 +1099,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION variant(_Tp&& __t) noexcept(is_nothrow_constructible_v<__accepted_type<_Tp&&>, _Tp&&>) : variant(in_place_index<__accepted_index<_Tp&&>>, - std::forward<_Tp>(__t)) + std::forward<_Tp>(__t)) { __glibcxx_assert(holds_alternative<__accepted_type<_Tp&&>>(*this)); } template<typename _Tp, typename... _Args, @@ -1117,7 +1108,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr explicit variant(in_place_type_t<_Tp>, _Args&&... __args) : variant(in_place_index<__index_of<_Tp>>, - std::forward<_Args>(__args)...) + std::forward<_Args>(__args)...) { __glibcxx_assert(holds_alternative<_Tp>(*this)); } template<typename _Tp, typename _Up, typename... _Args, @@ -1288,7 +1279,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static constexpr bool \ (*_S_erased_##__NAME[])(const variant&, const variant&) = \ { &__detail::__variant::__erased_##__NAME< \ - const variant&, __indices>... }; \ + const variant&, __indices>... }; \ template<size_t... __indices> \ constexpr inline bool \ _M_##__NAME(const variant& __rhs, \ @@ -1312,18 +1303,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #undef _VARIANT_RELATION_FUNCTION_TEMPLATE template<size_t _Np, typename _Vp> - friend constexpr decltype(auto) __detail::__variant:: -#if _GLIBCXX_INLINE_VERSION - __8:: // Required due to PR c++/59256 -#endif - __get(_Vp&& __v); + friend constexpr decltype(auto) __detail::__variant::__get(_Vp&& __v); template<typename _Vp> - friend void* __detail::__variant:: -#if _GLIBCXX_INLINE_VERSION - __8:: // Required due to PR c++/59256 -#endif - __get_storage(_Vp&& __v); + friend void* __detail::__variant::__get_storage(_Vp&& __v); #define _VARIANT_RELATION_FUNCTION_TEMPLATE(__OP) \ template<typename... _Tp> \ @@ -1434,7 +1417,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename... _Types> struct hash<variant<_Types...>> : private __detail::__variant::_Variant_hash_base< - variant<_Types...>, std::index_sequence_for<_Types...>>, + variant<_Types...>, std::index_sequence_for<_Types...>>, public __variant_hash_call_base<_Types...> { using result_type = size_t; |