diff options
Diffstat (limited to 'gcc-4.9/libstdc++-v3/include')
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/Makefile.in | 2 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/bits/stl_tree.h | 26 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/c_compatibility/complex.h | 2 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/debug/array | 2 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/ext/aligned_buffer.h | 41 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/array | 11 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/complex | 6 |
7 files changed, 67 insertions, 23 deletions
diff --git a/gcc-4.9/libstdc++-v3/include/Makefile.in b/gcc-4.9/libstdc++-v3/include/Makefile.in index e66f0dce0..8d4e79960 100644 --- a/gcc-4.9/libstdc++-v3/include/Makefile.in +++ b/gcc-4.9/libstdc++-v3/include/Makefile.in @@ -173,6 +173,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ SYMVER_FILE = @SYMVER_FILE@ TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@ +USE_BIONIC_LIBS = @USE_BIONIC_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VTV_CXXFLAGS = @VTV_CXXFLAGS@ @@ -235,6 +236,7 @@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libtool_VERSION = @libtool_VERSION@ +libtool_version_info_string = @libtool_version_info_string@ localedir = @localedir@ localstatedir = @localstatedir@ lt_host_flags = @lt_host_flags@ diff --git a/gcc-4.9/libstdc++-v3/include/bits/stl_tree.h b/gcc-4.9/libstdc++-v3/include/bits/stl_tree.h index 61156dbf7..00ff1ac83 100644 --- a/gcc-4.9/libstdc++-v3/include/bits/stl_tree.h +++ b/gcc-4.9/libstdc++-v3/include/bits/stl_tree.h @@ -144,7 +144,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_valptr() const { return std::__addressof(_M_value_field); } #else - __gnu_cxx::__aligned_buffer<_Val> _M_storage; + __gnu_cxx::__aligned_membuf<_Val> _M_storage; _Val* _M_valptr() @@ -186,7 +186,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : _M_node() { } explicit - _Rb_tree_iterator(_Link_type __x) _GLIBCXX_NOEXCEPT + _Rb_tree_iterator(_Base_ptr __x) _GLIBCXX_NOEXCEPT : _M_node(__x) { } reference @@ -258,7 +258,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : _M_node() { } explicit - _Rb_tree_const_iterator(_Link_type __x) _GLIBCXX_NOEXCEPT + _Rb_tree_const_iterator(_Base_ptr __x) _GLIBCXX_NOEXCEPT : _M_node(__x) { } _Rb_tree_const_iterator(const iterator& __it) _GLIBCXX_NOEXCEPT @@ -266,8 +266,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION iterator _M_const_cast() const _GLIBCXX_NOEXCEPT - { return iterator(static_cast<typename iterator::_Link_type> - (const_cast<typename iterator::_Base_ptr>(_M_node))); } + { return iterator(const_cast<typename iterator::_Base_ptr>(_M_node)); } reference operator*() const _GLIBCXX_NOEXCEPT @@ -764,28 +763,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION iterator begin() _GLIBCXX_NOEXCEPT - { - return iterator(static_cast<_Link_type> - (this->_M_impl._M_header._M_left)); - } + { return iterator(this->_M_impl._M_header._M_left); } const_iterator begin() const _GLIBCXX_NOEXCEPT - { - return const_iterator(static_cast<_Const_Link_type> - (this->_M_impl._M_header._M_left)); - } + { return const_iterator(this->_M_impl._M_header._M_left); } iterator end() _GLIBCXX_NOEXCEPT - { return iterator(static_cast<_Link_type>(&this->_M_impl._M_header)); } + { return iterator(&this->_M_impl._M_header); } const_iterator end() const _GLIBCXX_NOEXCEPT - { - return const_iterator(static_cast<_Const_Link_type> - (&this->_M_impl._M_header)); - } + { return const_iterator(&this->_M_impl._M_header); } reverse_iterator rbegin() _GLIBCXX_NOEXCEPT diff --git a/gcc-4.9/libstdc++-v3/include/c_compatibility/complex.h b/gcc-4.9/libstdc++-v3/include/c_compatibility/complex.h index b15361ea0..a79b4e4cc 100644 --- a/gcc-4.9/libstdc++-v3/include/c_compatibility/complex.h +++ b/gcc-4.9/libstdc++-v3/include/c_compatibility/complex.h @@ -39,7 +39,7 @@ // <complex.h> is defined to provide only what C++11's <ccomplex> does in a // different namespace. #ifdef _GLIBCXX_COMPLEX -# error Cannot include both <complex> and C99's <complex.h> +# error "Cannot include both <complex> and C99 <complex.h>" #endif // Delegate to a system complex.h if we don't provide it as part of the C++ diff --git a/gcc-4.9/libstdc++-v3/include/debug/array b/gcc-4.9/libstdc++-v3/include/debug/array index cd3eb0a20..637ab51a3 100644 --- a/gcc-4.9/libstdc++-v3/include/debug/array +++ b/gcc-4.9/libstdc++-v3/include/debug/array @@ -220,7 +220,7 @@ namespace __debug const_pointer data() const noexcept - { return _AT_Type::_S_ptrr(_M_elems, 0); } + { return _AT_Type::_S_ptr(_M_elems, 0); } }; // Array comparisons. diff --git a/gcc-4.9/libstdc++-v3/include/ext/aligned_buffer.h b/gcc-4.9/libstdc++-v3/include/ext/aligned_buffer.h index 861de5be3..99c4575c5 100644 --- a/gcc-4.9/libstdc++-v3/include/ext/aligned_buffer.h +++ b/gcc-4.9/libstdc++-v3/include/ext/aligned_buffer.h @@ -39,7 +39,48 @@ namespace __gnu_cxx { + // A utility type containing a POD object that can hold an object of type + // _Tp initialized via placement new or allocator_traits::construct. + // Intended for use as a data member subobject, use __aligned_buffer for + // complete objects. template<typename _Tp> + struct __aligned_membuf + { + // Target macro ADJUST_FIELD_ALIGN can produce different alignment for + // types when used as class members. __aligned_membuf is intended + // for use as a class member, so align the buffer as for a class member. + struct _Tp2 { _Tp _M_t; }; + + alignas(__alignof__(_Tp2::_M_t)) unsigned char _M_storage[sizeof(_Tp)]; + + __aligned_membuf() = default; + + // Can be used to avoid value-initialization zeroing _M_storage. + __aligned_membuf(std::nullptr_t) { } + + void* + _M_addr() noexcept + { return static_cast<void*>(&_M_storage); } + + const void* + _M_addr() const noexcept + { return static_cast<const void*>(&_M_storage); } + + _Tp* + _M_ptr() noexcept + { return static_cast<_Tp*>(_M_addr()); } + + const _Tp* + _M_ptr() const noexcept + { return static_cast<const _Tp*>(_M_addr()); } + }; + + // Similar to __aligned_membuf but aligned for complete objects, not members. + // This type is used in <forward_list>, <future>, <bits/shared_ptr_base.h> + // and <bits/hashtable_policy.h>, but ideally they would use __aligned_membuf + // instead, as it has smaller size for some types on some targets. + // This type is still used to avoid an ABI change. + template<typename _Tp> struct __aligned_buffer : std::aligned_storage<sizeof(_Tp), std::alignment_of<_Tp>::value> { diff --git a/gcc-4.9/libstdc++-v3/include/std/array b/gcc-4.9/libstdc++-v3/include/std/array index b7abeb09b..58557901a 100644 --- a/gcc-4.9/libstdc++-v3/include/std/array +++ b/gcc-4.9/libstdc++-v3/include/std/array @@ -50,7 +50,18 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER static constexpr _Tp* _S_ptr(const _Type& __t, std::size_t __n) noexcept +#if __google_stl_debug_array + { + return __n < _Nm + ? const_cast<_Tp*>(std::__addressof(__t[__n])) + : (std::__throw_out_of_range_fmt(__N("array::_S_ptr: __n " + "(which is %zu) >= size() " + "(which is %zu)"), + __n, _Nm), nullptr); + } +#else { return const_cast<_Tp*>(std::__addressof(__t[__n])); } +#endif }; template<typename _Tp> diff --git a/gcc-4.9/libstdc++-v3/include/std/complex b/gcc-4.9/libstdc++-v3/include/std/complex index 3104b584e..f4fe2f35f 100644 --- a/gcc-4.9/libstdc++-v3/include/std/complex +++ b/gcc-4.9/libstdc++-v3/include/std/complex @@ -50,7 +50,7 @@ // <complex.h> is defined to provide only what C++11's <ccomplex> does in a // different namespace. #ifdef _GLIBCXX_C99_COMPLEX_H -#error Cannot include both <complex> and C99's <complex.h> +#error "Cannot include both <complex> and C99 <complex.h>" #endif namespace std _GLIBCXX_VISIBILITY(default) @@ -147,11 +147,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // DR 387. std::complex over-encapsulated. _GLIBCXX_ABI_TAG_CXX11 constexpr _Tp - real() { return _M_real; } + real() const { return _M_real; } _GLIBCXX_ABI_TAG_CXX11 constexpr _Tp - imag() { return _M_imag; } + imag() const { return _M_imag; } #else /// Return real part of complex number. _Tp& |