diff options
author | Caroline Tice <cmtice@google.com> | 2016-02-29 22:49:18 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-02-29 22:49:18 +0000 |
commit | 3a800d7d75ceba88429096186a2150a2d938334a (patch) | |
tree | 9d9c36a627f01c31b077cd8253acc681d5cc4bbf /gcc-4.9/libstdc++-v3/include/std | |
parent | b9de1157289455b0ca26daff519d4a0ddcd1fa13 (diff) | |
parent | 817a788f9eb01eff367191401d48f2aaa8d4f428 (diff) | |
download | toolchain_gcc-3a800d7d75ceba88429096186a2150a2d938334a.tar.gz toolchain_gcc-3a800d7d75ceba88429096186a2150a2d938334a.tar.bz2 toolchain_gcc-3a800d7d75ceba88429096186a2150a2d938334a.zip |
Merge "Unify ChromeOS and Android versions of GCC."
Diffstat (limited to 'gcc-4.9/libstdc++-v3/include/std')
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/array | 11 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/complex | 6 |
2 files changed, 14 insertions, 3 deletions
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& |