diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2019-03-14 21:56:57 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2019-03-14 21:56:57 +0000 |
| commit | 5f6a5ac19cddda2fbc67582d6b12a92493e60b4e (patch) | |
| tree | a16ea9055eeaab30076137a79f6b79c0b735f965 /libcxx/include/array | |
| parent | 7f7867b05ab763d17b4017cf51f089523d475654 (diff) | |
| download | bcm5719-llvm-5f6a5ac19cddda2fbc67582d6b12a92493e60b4e.tar.gz bcm5719-llvm-5f6a5ac19cddda2fbc67582d6b12a92493e60b4e.zip | |
Add noexcept to operator[] for array and deque. This is an extension. We already do this for string and string_view. This should give better codegen inside of noexcept functions.
llvm-svn: 356209
Diffstat (limited to 'libcxx/include/array')
| -rw-r--r-- | libcxx/include/array | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libcxx/include/array b/libcxx/include/array index 05c4b65275d..320bfd5e679 100644 --- a/libcxx/include/array +++ b/libcxx/include/array @@ -190,9 +190,9 @@ struct _LIBCPP_TEMPLATE_VIS array // element access: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - reference operator[](size_type __n) {return __elems_[__n];} + reference operator[](size_type __n) _NOEXCEPT {return __elems_[__n];} _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - const_reference operator[](size_type __n) const {return __elems_[__n];} + const_reference operator[](size_type __n) const _NOEXCEPT {return __elems_[__n];} _LIBCPP_CONSTEXPR_AFTER_CXX14 reference at(size_type __n); _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type __n) const; @@ -303,13 +303,13 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> // element access: _LIBCPP_INLINE_VISIBILITY - reference operator[](size_type) { + reference operator[](size_type) _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array"); _LIBCPP_UNREACHABLE(); } _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - const_reference operator[](size_type) const { + const_reference operator[](size_type) const _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array"); _LIBCPP_UNREACHABLE(); } |

