[libcxx-commits] [libcxx] dea74b2 - [libc++] Add `noexcept` to `string::find` and similar members.

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 9 11:48:32 PST 2021


Author: zoecarver
Date: 2021-02-09T11:47:40-08:00
New Revision: dea74b2820612ecca967528f7f2bbcc6d05801fe

URL: https://github.com/llvm/llvm-project/commit/dea74b2820612ecca967528f7f2bbcc6d05801fe
DIFF: https://github.com/llvm/llvm-project/commit/dea74b2820612ecca967528f7f2bbcc6d05801fe.diff

LOG: [libc++] Add `noexcept` to `string::find` and similar members.

Adds `noexcept` to `string_view`/`string::find` and similar members
(`rfind`, etc.). See discussion in D95251. Refs D95821.

Reviewed By: curdeius, ldionne

Differential Revision: https://reviews.llvm.org/D95848

Added: 
    

Modified: 
    libcxx/include/__string
    libcxx/include/string
    libcxx/include/string_view
    libcxx/test/std/strings/basic.string/string.ops/string_compare/pointer.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_compare/string_view.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/char_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/pointer_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_view_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/char_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/pointer_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/string_view_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/char_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/pointer_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_view_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/char_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/pointer_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_view_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find/char_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find/string_view_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_rfind/char_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_rfind/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_rfind/pointer_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_rfind/string_view_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_char_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_char_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_of_char_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_of_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_of_string_view_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_char_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_of_char_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_of_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_of_string_view_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_pointer_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_string_view_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/rfind_char_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/rfind_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/rfind_pointer_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/rfind_string_view_size.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__string b/libcxx/include/__string
index d8b672e4c1be..5b340d03ad86 100644
--- a/libcxx/include/__string
+++ b/libcxx/include/__string
@@ -953,7 +953,7 @@ __str_find(const _CharT *__p, _SizeT __sz,
 template <class _CharT, class _Traits>
 inline _LIBCPP_CONSTEXPR_AFTER_CXX11 const _CharT *
 __search_substring(const _CharT *__first1, const _CharT *__last1,
-                   const _CharT *__first2, const _CharT *__last2) {
+                   const _CharT *__first2, const _CharT *__last2) _NOEXCEPT {
   // Take advantage of knowing source and pattern lengths.
   // Stop short when source is smaller than pattern.
   const ptr
diff _t __len2 = __last2 - __first2;

diff  --git a/libcxx/include/string b/libcxx/include/string
index 687795c79bb9..b0521641670a 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -262,49 +262,49 @@ public:
 
     size_type find(const basic_string& str, size_type pos = 0) const noexcept;
     template <class T>
-        size_type find(const T& t, size_type pos = 0) const;  // C++17
+        size_type find(const T& t, size_type pos = 0) const noexcept; // C++17, noexcept as an extension
     size_type find(const value_type* s, size_type pos, size_type n) const noexcept;
     size_type find(const value_type* s, size_type pos = 0) const noexcept;
     size_type find(value_type c, size_type pos = 0) const noexcept;
 
     size_type rfind(const basic_string& str, size_type pos = npos) const noexcept;
     template <class T>
-        size_type rfind(const T& t, size_type pos = npos) const;  // C++17
+        size_type rfind(const T& t, size_type pos = npos) const noexcept; // C++17, noexcept as an extension
     size_type rfind(const value_type* s, size_type pos, size_type n) const noexcept;
     size_type rfind(const value_type* s, size_type pos = npos) const noexcept;
     size_type rfind(value_type c, size_type pos = npos) const noexcept;
 
     size_type find_first_of(const basic_string& str, size_type pos = 0) const noexcept;
     template <class T>
-        size_type find_first_of(const T& t, size_type pos = 0) const; // C++17
+        size_type find_first_of(const T& t, size_type pos = 0) const noexcept; // C++17, noexcept as an extension
     size_type find_first_of(const value_type* s, size_type pos, size_type n) const noexcept;
     size_type find_first_of(const value_type* s, size_type pos = 0) const noexcept;
     size_type find_first_of(value_type c, size_type pos = 0) const noexcept;
 
     size_type find_last_of(const basic_string& str, size_type pos = npos) const noexcept;
     template <class T>
-        size_type find_last_of(const T& t, size_type pos = npos) const noexcept;  // C++17
+        size_type find_last_of(const T& t, size_type pos = npos) const noexcept noexcept; // C++17, noexcept as an extension
     size_type find_last_of(const value_type* s, size_type pos, size_type n) const noexcept;
     size_type find_last_of(const value_type* s, size_type pos = npos) const noexcept;
     size_type find_last_of(value_type c, size_type pos = npos) const noexcept;
 
     size_type find_first_not_of(const basic_string& str, size_type pos = 0) const noexcept;
     template <class T>
-        size_type find_first_not_of(const T& t, size_type pos = 0) const; // C++17
+        size_type find_first_not_of(const T& t, size_type pos = 0) const noexcept; // C++17, noexcept as an extension
     size_type find_first_not_of(const value_type* s, size_type pos, size_type n) const noexcept;
     size_type find_first_not_of(const value_type* s, size_type pos = 0) const noexcept;
     size_type find_first_not_of(value_type c, size_type pos = 0) const noexcept;
 
     size_type find_last_not_of(const basic_string& str, size_type pos = npos) const noexcept;
     template <class T>
-        size_type find_last_not_of(const T& t, size_type pos = npos) const; // C++17
+        size_type find_last_not_of(const T& t, size_type pos = npos) const noexcept; // C++17, noexcept as an extension
     size_type find_last_not_of(const value_type* s, size_type pos, size_type n) const noexcept;
     size_type find_last_not_of(const value_type* s, size_type pos = npos) const noexcept;
     size_type find_last_not_of(value_type c, size_type pos = npos) const noexcept;
 
     int compare(const basic_string& str) const noexcept;
     template <class T>
-        int compare(const T& t) const noexcept;  // C++17
+        int compare(const T& t) const noexcept;  // C++17, noexcept as an extension
     int compare(size_type pos1, size_type n1, const basic_string& str) const;
     template <class T>
         int compare(size_type pos1, size_type n1, const T& t) const;  // C++17
@@ -1284,7 +1284,7 @@ public:
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             size_type
         >
-              find(const _Tp& __t, size_type __pos = 0) const;
+              find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
     size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
     _LIBCPP_INLINE_VISIBILITY
     size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
@@ -1300,7 +1300,7 @@ public:
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             size_type
         >
-              rfind(const _Tp& __t, size_type __pos = npos) const;
+              rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
     size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
     _LIBCPP_INLINE_VISIBILITY
     size_type rfind(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
@@ -1316,7 +1316,7 @@ public:
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             size_type
         >
-              find_first_of(const _Tp& __t, size_type __pos = 0) const;
+              find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
     size_type find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
     _LIBCPP_INLINE_VISIBILITY
     size_type find_first_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
@@ -1333,7 +1333,7 @@ public:
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             size_type
         >
-              find_last_of(const _Tp& __t, size_type __pos = npos) const;
+              find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
     size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
     _LIBCPP_INLINE_VISIBILITY
     size_type find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
@@ -1350,7 +1350,7 @@ public:
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             size_type
         >
-              find_first_not_of(const _Tp &__t, size_type __pos = 0) const;
+              find_first_not_of(const _Tp &__t, size_type __pos = 0) const _NOEXCEPT;
     size_type find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
     _LIBCPP_INLINE_VISIBILITY
     size_type find_first_not_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
@@ -1367,7 +1367,7 @@ public:
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             size_type
         >
-              find_last_not_of(const _Tp& __t, size_type __pos = npos) const;
+              find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
     size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
     _LIBCPP_INLINE_VISIBILITY
     size_type find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
@@ -1384,7 +1384,7 @@ public:
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             int
         >
-        compare(const _Tp &__t) const;
+        compare(const _Tp &__t) const _NOEXCEPT;
 
     template <class _Tp>
     _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
@@ -3543,7 +3543,7 @@ _EnableIf
     typename basic_string<_CharT, _Traits, _Allocator>::size_type
 >
 basic_string<_CharT, _Traits, _Allocator>::find(const _Tp &__t,
-                                                size_type __pos) const
+                                                size_type __pos) const _NOEXCEPT
 {
     __self_view __sv = __t;
     return __str_find<value_type, size_type, traits_type, npos>
@@ -3601,7 +3601,7 @@ _EnableIf
     typename basic_string<_CharT, _Traits, _Allocator>::size_type
 >
 basic_string<_CharT, _Traits, _Allocator>::rfind(const _Tp& __t,
-                                                size_type __pos) const
+                                                size_type __pos) const _NOEXCEPT
 {
     __self_view __sv = __t;
     return __str_rfind<value_type, size_type, traits_type, npos>
@@ -3659,7 +3659,7 @@ _EnableIf
     typename basic_string<_CharT, _Traits, _Allocator>::size_type
 >
 basic_string<_CharT, _Traits, _Allocator>::find_first_of(const _Tp& __t,
-                                                size_type __pos) const
+                                                size_type __pos) const _NOEXCEPT
 {
     __self_view __sv = __t;
     return __str_find_first_of<value_type, size_type, traits_type, npos>
@@ -3717,7 +3717,7 @@ _EnableIf
     typename basic_string<_CharT, _Traits, _Allocator>::size_type
 >
 basic_string<_CharT, _Traits, _Allocator>::find_last_of(const _Tp& __t,
-                                                size_type __pos) const
+                                                size_type __pos) const _NOEXCEPT
 {
     __self_view __sv = __t;
     return __str_find_last_of<value_type, size_type, traits_type, npos>
@@ -3775,7 +3775,7 @@ _EnableIf
     typename basic_string<_CharT, _Traits, _Allocator>::size_type
 >
 basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const _Tp& __t,
-                                                size_type __pos) const
+                                                size_type __pos) const _NOEXCEPT
 {
     __self_view __sv = __t;
     return __str_find_first_not_of<value_type, size_type, traits_type, npos>
@@ -3834,7 +3834,7 @@ _EnableIf
     typename basic_string<_CharT, _Traits, _Allocator>::size_type
 >
 basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const _Tp& __t,
-                                                size_type __pos) const
+                                                size_type __pos) const _NOEXCEPT
 {
     __self_view __sv = __t;
     return __str_find_last_not_of<value_type, size_type, traits_type, npos>
@@ -3871,7 +3871,7 @@ _EnableIf
     __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
     int
 >
-basic_string<_CharT, _Traits, _Allocator>::compare(const _Tp& __t) const
+basic_string<_CharT, _Traits, _Allocator>::compare(const _Tp& __t) const _NOEXCEPT
 {
     __self_view __sv = __t;
     size_t __lhs_sz = size();

diff  --git a/libcxx/include/string_view b/libcxx/include/string_view
index bc0245cf2b5e..f8c63571f3c4 100644
--- a/libcxx/include/string_view
+++ b/libcxx/include/string_view
@@ -119,28 +119,28 @@ namespace std {
                             const charT* s, size_type n2) const;
       constexpr size_type find(basic_string_view s, size_type pos = 0) const noexcept;
       constexpr size_type find(charT c, size_type pos = 0) const noexcept;
-      constexpr size_type find(const charT* s, size_type pos, size_type n) const;
-      constexpr size_type find(const charT* s, size_type pos = 0) const;
+      constexpr size_type find(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension
+      constexpr size_type find(const charT* s, size_type pos = 0) const noexcept; // noexcept as an extension
       constexpr size_type rfind(basic_string_view s, size_type pos = npos) const noexcept;
       constexpr size_type rfind(charT c, size_type pos = npos) const noexcept;
-      constexpr size_type rfind(const charT* s, size_type pos, size_type n) const;
-      constexpr size_type rfind(const charT* s, size_type pos = npos) const;
+      constexpr size_type rfind(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension
+      constexpr size_type rfind(const charT* s, size_type pos = npos) const noexcept; // noexcept as an extension
       constexpr size_type find_first_of(basic_string_view s, size_type pos = 0) const noexcept;
       constexpr size_type find_first_of(charT c, size_type pos = 0) const noexcept;
-      constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const;
-      constexpr size_type find_first_of(const charT* s, size_type pos = 0) const;
+      constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension
+      constexpr size_type find_first_of(const charT* s, size_type pos = 0) const noexcept; // noexcept as an extension
       constexpr size_type find_last_of(basic_string_view s, size_type pos = npos) const noexcept;
       constexpr size_type find_last_of(charT c, size_type pos = npos) const noexcept;
-      constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const;
-      constexpr size_type find_last_of(const charT* s, size_type pos = npos) const;
+      constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension
+      constexpr size_type find_last_of(const charT* s, size_type pos = npos) const noexcept; // noexcept as an extension
       constexpr size_type find_first_not_of(basic_string_view s, size_type pos = 0) const noexcept;
       constexpr size_type find_first_not_of(charT c, size_type pos = 0) const noexcept;
-      constexpr size_type find_first_not_of(const charT* s, size_type pos, size_type n) const;
-      constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const;
+      constexpr size_type find_first_not_of(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension
+      constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const noexcept; // noexcept as an extension
       constexpr size_type find_last_not_of(basic_string_view s, size_type pos = npos) const noexcept;
       constexpr size_type find_last_not_of(charT c, size_type pos = npos) const noexcept;
-      constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const;
-      constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const;
+      constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension
+      constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const noexcept; // noexcept as an extension
 
       constexpr bool starts_with(basic_string_view s) const noexcept; // C++20
       constexpr bool starts_with(charT c) const noexcept;             // C++20
@@ -431,7 +431,7 @@ public:
     }
 
     _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-    size_type find(const _CharT* __s, size_type __pos, size_type __n) const
+    size_type find(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
     {
         _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find(): received nullptr");
         return __str_find<value_type, size_type, traits_type, npos>
@@ -439,7 +439,7 @@ public:
     }
 
     _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-    size_type find(const _CharT* __s, size_type __pos = 0) const
+    size_type find(const _CharT* __s, size_type __pos = 0) const _NOEXCEPT
     {
         _LIBCPP_ASSERT(__s != nullptr, "string_view::find(): received nullptr");
         return __str_find<value_type, size_type, traits_type, npos>
@@ -463,7 +463,7 @@ public:
     }
 
     _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-    size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const
+    size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
     {
         _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::rfind(): received nullptr");
         return __str_rfind<value_type, size_type, traits_type, npos>
@@ -471,7 +471,7 @@ public:
     }
 
     _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-    size_type rfind(const _CharT* __s, size_type __pos=npos) const
+    size_type rfind(const _CharT* __s, size_type __pos=npos) const _NOEXCEPT
     {
         _LIBCPP_ASSERT(__s != nullptr, "string_view::rfind(): received nullptr");
         return __str_rfind<value_type, size_type, traits_type, npos>
@@ -492,7 +492,7 @@ public:
     { return find(__c, __pos); }
 
     _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-    size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+    size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
     {
         _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_of(): received nullptr");
         return __str_find_first_of<value_type, size_type, traits_type, npos>
@@ -500,7 +500,7 @@ public:
     }
 
     _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-    size_type find_first_of(const _CharT* __s, size_type __pos=0) const
+    size_type find_first_of(const _CharT* __s, size_type __pos=0) const _NOEXCEPT
     {
         _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_of(): received nullptr");
         return __str_find_first_of<value_type, size_type, traits_type, npos>
@@ -521,7 +521,7 @@ public:
     { return rfind(__c, __pos); }
 
     _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-    size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+    size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
     {
         _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_of(): received nullptr");
         return __str_find_last_of<value_type, size_type, traits_type, npos>
@@ -529,7 +529,7 @@ public:
     }
 
     _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-    size_type find_last_of(const _CharT* __s, size_type __pos=npos) const
+    size_type find_last_of(const _CharT* __s, size_type __pos=npos) const _NOEXCEPT
     {
         _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_of(): received nullptr");
         return __str_find_last_of<value_type, size_type, traits_type, npos>
@@ -553,7 +553,7 @@ public:
     }
 
     _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-    size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+    size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
     {
         _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): received nullptr");
         return __str_find_first_not_of<value_type, size_type, traits_type, npos>
@@ -561,7 +561,7 @@ public:
     }
 
     _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-    size_type find_first_not_of(const _CharT* __s, size_type __pos=0) const
+    size_type find_first_not_of(const _CharT* __s, size_type __pos=0) const _NOEXCEPT
     {
         _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_not_of(): received nullptr");
         return __str_find_first_not_of<value_type, size_type, traits_type, npos>
@@ -585,7 +585,7 @@ public:
     }
 
     _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-    size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+    size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
     {
         _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): received nullptr");
         return __str_find_last_not_of<value_type, size_type, traits_type, npos>
@@ -593,7 +593,7 @@ public:
     }
 
     _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-    size_type find_last_not_of(const _CharT* __s, size_type __pos=npos) const
+    size_type find_last_not_of(const _CharT* __s, size_type __pos=npos) const _NOEXCEPT
     {
         _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_not_of(): received nullptr");
         return __str_find_last_not_of<value_type, size_type, traits_type, npos>

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_compare/pointer.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_compare/pointer.pass.cpp
index eac5d0b73938..072f062fca75 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_compare/pointer.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_compare/pointer.pass.cpp
@@ -29,6 +29,7 @@ template <class S>
 void
 test(const S& s, const typename S::value_type* str, int x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.compare(str));
     assert(sign(s.compare(str)) == sign(x));
 }
 

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp
index 279ae3075846..76237cda8a8c 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp
@@ -29,6 +29,7 @@ template <class S>
 void
 test(const S& s, const S& str, int x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.compare(str));
     assert(sign(s.compare(str)) == sign(x));
 }
 

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_compare/string_view.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_compare/string_view.pass.cpp
index f2cec2088809..fc145f8576c5 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_compare/string_view.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_compare/string_view.pass.cpp
@@ -29,6 +29,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, int x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.compare(sv));
     assert(sign(s.compare(sv)) == sign(x));
 }
 

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/char_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/char_size.pass.cpp
index 9d2d0f729a26..bf688efbfe3b 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/char_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/char_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, typename S::value_type c, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(c, pos));
     assert(s.find_first_not_of(c, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, typename S::value_type c, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(c));
     assert(s.find_first_not_of(c) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/pointer_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/pointer_size.pass.cpp
index c1556b1b21fc..37ae43e77a37 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/pointer_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(str, pos));
     assert(s.find_first_not_of(str, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/pointer_size_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/pointer_size_size.pass.cpp
index de629093b66c..d4776a0c56cf 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/pointer_size_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/pointer_size_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type n, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(str, pos, n));
     assert(s.find_first_not_of(str, pos, n) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp
index 7f12ab1ba27c..554b4a687d57 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(str, pos));
     assert(s.find_first_not_of(str, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());
@@ -29,6 +30,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(str));
     assert(s.find_first_not_of(str) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_view_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_view_size.pass.cpp
index eea47227e9c7..51cef0fea4b0 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_view_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_view_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(sv, pos));
     assert(s.find_first_not_of(sv, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());
@@ -29,6 +30,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(sv));
     assert(s.find_first_not_of(sv) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/char_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/char_size.pass.cpp
index 9e8dfdafb59c..7ba1c618de64 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/char_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/char_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, typename S::value_type c, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(c, pos));
     assert(s.find_first_of(c, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, typename S::value_type c, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(c));
     assert(s.find_first_of(c) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/pointer_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/pointer_size.pass.cpp
index fd37402c5a08..a54f4801a5b9 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/pointer_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str, pos));
     assert(s.find_first_of(str, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, const typename S::value_type* str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str));
     assert(s.find_first_of(str) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/pointer_size_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/pointer_size_size.pass.cpp
index 145471628a16..e95066aeb2c7 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/pointer_size_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/pointer_size_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type n, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str, pos, n));
     assert(s.find_first_of(str, pos, n) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp
index 1ae2123c3eb4..d30254adb3ed 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str, pos));
     assert(s.find_first_of(str, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());
@@ -29,6 +30,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str));
     assert(s.find_first_of(str) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/string_view_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/string_view_size.pass.cpp
index 33bc971ae479..7570c33465d4 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/string_view_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/string_view_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(sv, pos));
     assert(s.find_first_of(sv, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());
@@ -29,6 +30,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(sv));
     assert(s.find_first_of(sv) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/char_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/char_size.pass.cpp
index c2950250b087..25120bb17a4b 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/char_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/char_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, typename S::value_type c, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(c, pos));
     assert(s.find_last_not_of(c, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, typename S::value_type c, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(c));
     assert(s.find_last_not_of(c) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/pointer_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/pointer_size.pass.cpp
index a5ac3e8ec970..56c0ee74ebc2 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/pointer_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(str, pos));
     assert(s.find_last_not_of(str, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, const typename S::value_type* str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(str));
     assert(s.find_last_not_of(str) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/pointer_size_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/pointer_size_size.pass.cpp
index 5bc5a8cf203c..0b4eb9698cc8 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/pointer_size_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/pointer_size_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type n, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(str, pos, n));
     assert(s.find_last_not_of(str, pos, n) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp
index 8232612c1e70..1c2bd125c91c 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(str, pos));
     assert(s.find_last_not_of(str, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -29,6 +30,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(str));
     assert(s.find_last_not_of(str) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_view_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_view_size.pass.cpp
index 795290615587..9b7d8d0210ae 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_view_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_view_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(sv, pos));
     assert(s.find_last_not_of(sv, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -29,6 +30,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(sv));
     assert(s.find_last_not_of(sv) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/char_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/char_size.pass.cpp
index 8ea48fe0dba1..3273ecd35104 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/char_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/char_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, typename S::value_type c, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(c, pos));
     assert(s.find_last_of(c, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, typename S::value_type c, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(c));
     assert(s.find_last_of(c) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/pointer_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/pointer_size.pass.cpp
index 8045ac056d04..a86c104d9562 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/pointer_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str, pos));
     assert(s.find_last_of(str, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, const typename S::value_type* str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str));
     assert(s.find_last_of(str) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/pointer_size_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/pointer_size_size.pass.cpp
index 855139faaa4d..c3420d5cfaa8 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/pointer_size_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/pointer_size_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type n, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str, pos, n));
     assert(s.find_last_of(str, pos, n) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp
index f3ddb468d498..a6e8d1a69c0a 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str, pos));
     assert(s.find_last_of(str, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -29,6 +30,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str));
     assert(s.find_last_of(str) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_view_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_view_size.pass.cpp
index 63f03e74fa01..a44ddd9bd159 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_view_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_view_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(sv, pos));
     assert(s.find_last_of(sv, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -29,6 +30,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(sv));
     assert(s.find_last_of(sv) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find/char_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find/char_size.pass.cpp
index 6f92ef12d551..bbd846142abd 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find/char_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find/char_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, typename S::value_type c, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(c, pos));
     assert(s.find(c, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x + 1 <= s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, typename S::value_type c, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(c));
     assert(s.find(c) == x);
     if (x != S::npos)
         assert(0 <= x && x + 1 <= s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp
index 1cc6cb96a40b..c06797a24588 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(str, pos));
     assert(s.find(str, pos) == x);
     if (x != S::npos)
     {
@@ -33,6 +34,7 @@ template <class S>
 void
 test(const S& s, const typename S::value_type* str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(str));
     assert(s.find(str) == x);
     if (x != S::npos)
     {

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size_size.pass.cpp
index d640be7218fe..3ca6b3a7d5f8 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type n, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(str, pos, n));
     assert(s.find(str, pos, n) == x);
     if (x != S::npos)
         assert(pos <= x && x + n <= s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp
index e8a91dd1f67b..3aef261a01fe 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(str, pos));
     assert(s.find(str, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x + str.size() <= s.size());
@@ -29,6 +30,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(str));
     assert(s.find(str) == x);
     if (x != S::npos)
         assert(0 <= x && x + str.size() <= s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_find/string_view_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find/string_view_size.pass.cpp
index 08baa745ea51..c74b5a44a87c 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_find/string_view_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_find/string_view_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(sv, pos));
     assert(s.find(sv, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x + sv.size() <= s.size());
@@ -29,6 +30,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(sv));
     assert(s.find(sv) == x);
     if (x != S::npos)
         assert(0 <= x && x + sv.size() <= s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_rfind/char_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_rfind/char_size.pass.cpp
index e3484bda79ed..49a5fbc5f86d 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_rfind/char_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_rfind/char_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, typename S::value_type c, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(c, pos));
     assert(s.rfind(c, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x + 1 <= s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, typename S::value_type c, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(c));
     assert(s.rfind(c) == x);
     if (x != S::npos)
         assert(x + 1 <= s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_rfind/pointer_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_rfind/pointer_size.pass.cpp
index b77d808f9bae..400616140598 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_rfind/pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_rfind/pointer_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(str, pos));
     assert(s.rfind(str, pos) == x);
     if (x != S::npos)
     {
@@ -33,6 +34,7 @@ template <class S>
 void
 test(const S& s, const typename S::value_type* str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(str));
     assert(s.rfind(str) == x);
     if (x != S::npos)
     {

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_rfind/pointer_size_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_rfind/pointer_size_size.pass.cpp
index 8e4e32e52a5f..2bcb486d9952 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_rfind/pointer_size_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_rfind/pointer_size_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
       typename S::size_type n, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(str, pos, n));
     assert(s.rfind(str, pos, n) == x);
     if (x != S::npos)
         assert(x <= pos && x + n <= s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp
index 74cfb02ee28c..a1932c7bcf62 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(str, pos));
     assert(s.rfind(str, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x + str.size() <= s.size());
@@ -29,6 +30,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(str));
     assert(s.rfind(str) == x);
     if (x != S::npos)
         assert(0 <= x && x + str.size() <= s.size());

diff  --git a/libcxx/test/std/strings/basic.string/string.ops/string_rfind/string_view_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_rfind/string_view_size.pass.cpp
index 7d0c4ff5d9be..ed9d87596532 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_rfind/string_view_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_rfind/string_view_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(sv, pos));
     assert(s.rfind(sv, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x + sv.size() <= s.size());
@@ -29,6 +30,7 @@ template <class S, class SV>
 void
 test(const S& s, SV sv, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(sv));
     assert(s.rfind(sv) == x);
     if (x != S::npos)
         assert(0 <= x && x + sv.size() <= s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_char_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_char_size.pass.cpp
index 15dff2e2bc6d..78c70c33457c 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_char_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_char_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, typename S::value_type c, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(c, pos));
     assert(s.find(c, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x + 1 <= s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_char_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_char_size.pass.cpp
index 1b050dd20d18..351eb1d2f44e 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_char_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_char_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, typename S::value_type c, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(c, pos));
     assert(s.find_first_not_of(c, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, typename S::value_type c, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(c));
     assert(s.find_first_not_of(c) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp
index 535860ec361b..8ca9d91434c3 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(str, pos));
     assert(s.find_first_not_of(str, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp
index 18fdda9000bc..d6f3a3fadef3 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type n, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(str, pos, n));
     assert(s.find_first_not_of(str, pos, n) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp
index 1408ffb8cfdb..163ab739dd10 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp
@@ -19,6 +19,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(str, pos));
     assert(s.find_first_not_of(str, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_first_of_char_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_first_of_char_size.pass.cpp
index b1bda4ea6542..e312ae88e0f5 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_first_of_char_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_first_of_char_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, typename S::value_type c, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(c, pos));
     assert(s.find_first_of(c, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_first_of_pointer_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_first_of_pointer_size.pass.cpp
index ee50e0c282fa..4ef219d1f1e8 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_first_of_pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_first_of_pointer_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str, pos));
     assert(s.find_first_of(str, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, const typename S::value_type* str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str));
     assert(s.find_first_of(str) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp
index 5e35f4c9531f..a2816d64ce37 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type n, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str, pos, n));
     assert(s.find_first_of(str, pos, n) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_first_of_string_view_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_first_of_string_view_size.pass.cpp
index aad1094538d3..1752f3be1825 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_first_of_string_view_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_first_of_string_view_size.pass.cpp
@@ -19,6 +19,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str, pos));
     assert(s.find_first_of(str, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x < s.size());
@@ -28,6 +29,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str));
     assert(s.find_first_of(str) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_char_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_char_size.pass.cpp
index c4c7fa490de4..d2cf8d5d94f9 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_char_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_char_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, typename S::value_type c, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(c, pos));
     assert(s.find_last_not_of(c, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, typename S::value_type c, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(c));
     assert(s.find_last_not_of(c) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp
index 48574cd61065..51f884733c5f 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(str, pos));
     assert(s.find_last_not_of(str, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp
index 3e46ed8d358d..ceb0e138bd02 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type n, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(str, pos, n));
     assert(s.find_last_not_of(str, pos, n) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp
index 289d5e314d74..2c57a46290b7 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp
@@ -19,6 +19,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(str, pos));
     assert(s.find_last_not_of(str, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -28,6 +29,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(str));
     assert(s.find_last_not_of(str) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_last_of_char_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_last_of_char_size.pass.cpp
index 0f8c6b025894..5cdae5c48c4e 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_last_of_char_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_last_of_char_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, typename S::value_type c, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(c, pos));
     assert(s.find_last_of(c, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, typename S::value_type c, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(c));
     assert(s.find_last_of(c) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_last_of_pointer_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_last_of_pointer_size.pass.cpp
index 4b2e8c8c27ff..e6e78ba65425 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_last_of_pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_last_of_pointer_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str, pos));
     assert(s.find_last_of(str, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -30,6 +31,7 @@ template <class S>
 void
 test(const S& s, const typename S::value_type* str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str));
     assert(s.find_last_of(str) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
index 318b211e1989..7f6001ea01b5 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type n, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str, pos, n));
     assert(s.find_last_of(str, pos, n) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_last_of_string_view_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_last_of_string_view_size.pass.cpp
index c60fc00347c0..aa8665fdb4e2 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_last_of_string_view_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_last_of_string_view_size.pass.cpp
@@ -19,6 +19,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str, pos));
     assert(s.find_last_of(str, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x < s.size());
@@ -28,6 +29,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str));
     assert(s.find_last_of(str) == x);
     if (x != S::npos)
         assert(x < s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_pointer_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_pointer_size.pass.cpp
index 67c01ec1e0f9..79f6bc30a91c 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_pointer_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(str, pos));
     assert(s.find(str, pos) == x);
     if (x != S::npos)
     {
@@ -33,6 +34,7 @@ template <class S>
 void
 test(const S& s, const typename S::value_type* str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(str));
     assert(s.find(str) == x);
     if (x != S::npos)
     {

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_pointer_size_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_pointer_size_size.pass.cpp
index dd5536b47982..d167b7d43fb0 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_pointer_size_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_pointer_size_size.pass.cpp
@@ -21,6 +21,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type n, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(str, pos, n));
     assert(s.find(str, pos, n) == x);
     if (x != S::npos)
         assert(pos <= x && x + n <= s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/find_string_view_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/find_string_view_size.pass.cpp
index 6f4aa90a1a4d..86790dcc1438 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/find_string_view_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/find_string_view_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(str, pos));
     assert(s.find(str, pos) == x);
     if (x != S::npos)
         assert(pos <= x && x + str.size() <= s.size());
@@ -29,6 +30,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.find(str));
     assert(s.find(str) == x);
     if (x != S::npos)
         assert(0 <= x && x + str.size() <= s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/rfind_char_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/rfind_char_size.pass.cpp
index e8229e1024e5..38236b812218 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/rfind_char_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/rfind_char_size.pass.cpp
@@ -20,6 +20,7 @@ void
 test(const S& s, typename S::value_type c, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(c, pos));
     assert(s.rfind(c, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x + 1 <= s.size());
@@ -29,6 +30,7 @@ template <class S>
 void
 test(const S& s, typename S::value_type c, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(c));
     assert(s.rfind(c) == x);
     if (x != S::npos)
         assert(x + 1 <= s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/rfind_pointer_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/rfind_pointer_size.pass.cpp
index 691fab4d5d0b..ebc8f6129241 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/rfind_pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/rfind_pointer_size.pass.cpp
@@ -20,6 +20,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
      typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(str, pos));
     assert(s.rfind(str, pos) == x);
     if (x != S::npos)
     {
@@ -32,6 +33,7 @@ template <class S>
 void
 test(const S& s, const typename S::value_type* str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(str));
     assert(s.rfind(str) == x);
     if (x != S::npos)
     {

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/rfind_pointer_size_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/rfind_pointer_size_size.pass.cpp
index 39a295dea805..de54121c0ca9 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/rfind_pointer_size_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/rfind_pointer_size_size.pass.cpp
@@ -20,6 +20,7 @@ void
 test(const S& s, const typename S::value_type* str, typename S::size_type pos,
       typename S::size_type n, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(str, pos, n));
     assert(s.rfind(str, pos, n) == x);
     if (x != S::npos)
         assert(x <= pos && x + n <= s.size());

diff  --git a/libcxx/test/std/strings/string.view/string.view.find/rfind_string_view_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.find/rfind_string_view_size.pass.cpp
index 7607bcf768b2..bce0225ea4e8 100644
--- a/libcxx/test/std/strings/string.view/string.view.find/rfind_string_view_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.find/rfind_string_view_size.pass.cpp
@@ -20,6 +20,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(str, pos));
     assert(s.rfind(str, pos) == x);
     if (x != S::npos)
         assert(x <= pos && x + str.size() <= s.size());
@@ -29,6 +30,7 @@ template <class S>
 void
 test(const S& s, const S& str, typename S::size_type x)
 {
+    LIBCPP_ASSERT_NOEXCEPT(s.rfind(str));
     assert(s.rfind(str) == x);
     if (x != S::npos)
         assert(0 <= x && x + str.size() <= s.size());


        


More information about the libcxx-commits mailing list