diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2019-03-19 03:30:07 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2019-03-19 03:30:07 +0000 |
| commit | 9ea0e473f0b96455b918eefcf8fc535638674a1f (patch) | |
| tree | 7d4d56a0ab1298b8cd8b065695ff2b9d6b06582f /libcxx/include/array | |
| parent | 89251edefcb46f0b5e0caf2bb47f38d115e12fa4 (diff) | |
| download | bcm5719-llvm-9ea0e473f0b96455b918eefcf8fc535638674a1f.tar.gz bcm5719-llvm-9ea0e473f0b96455b918eefcf8fc535638674a1f.zip | |
Mark 'front()' and 'back()' as noexcept for array/deque/string/string_view. These are just rebranded 'operator[]', and should be noexcept like it is.
llvm-svn: 356435
Diffstat (limited to 'libcxx/include/array')
| -rw-r--r-- | libcxx/include/array | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libcxx/include/array b/libcxx/include/array index 320bfd5e679..418a2a9fb74 100644 --- a/libcxx/include/array +++ b/libcxx/include/array @@ -197,10 +197,10 @@ struct _LIBCPP_TEMPLATE_VIS array _LIBCPP_CONSTEXPR_AFTER_CXX14 reference at(size_type __n); _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type __n) const; - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() {return __elems_[0];} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const {return __elems_[0];} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() {return __elems_[_Size - 1];} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const {return __elems_[_Size - 1];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() _NOEXCEPT {return __elems_[0];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const _NOEXCEPT {return __elems_[0];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() _NOEXCEPT {return __elems_[_Size - 1];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const _NOEXCEPT {return __elems_[_Size - 1];} _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 value_type* data() _NOEXCEPT {return __elems_;} @@ -327,25 +327,25 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> } _LIBCPP_INLINE_VISIBILITY - reference front() { + reference front() _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array"); _LIBCPP_UNREACHABLE(); } _LIBCPP_INLINE_VISIBILITY - const_reference front() const { + const_reference front() const _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array"); _LIBCPP_UNREACHABLE(); } _LIBCPP_INLINE_VISIBILITY - reference back() { + reference back() _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array"); _LIBCPP_UNREACHABLE(); } _LIBCPP_INLINE_VISIBILITY - const_reference back() const { + const_reference back() const _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array"); _LIBCPP_UNREACHABLE(); } |

