@@ -1037,13 +1037,14 @@ public:
10371037# endif // _LIBCPP_CXX03_LANG
10381038
10391039 template <__enable_if_t <__is_allocator<_Allocator>::value, int > = 0 >
1040- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string (const _CharT* __s) {
1040+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string (const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s) {
10411041 _LIBCPP_ASSERT_NON_NULL (__s != nullptr , " basic_string(const char*) detected nullptr" );
10421042 __init (__s, traits_type::length (__s));
10431043 }
10441044
10451045 template <__enable_if_t <__is_allocator<_Allocator>::value, int > = 0 >
1046- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string (const _CharT* __s, const _Allocator& __a)
1046+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
1047+ basic_string (const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, const _Allocator& __a)
10471048 : __alloc_(__a) {
10481049 _LIBCPP_ASSERT_NON_NULL (__s != nullptr , " basic_string(const char*, allocator) detected nullptr" );
10491050 __init (__s, traits_type::length (__s));
@@ -1214,7 +1215,8 @@ public:
12141215 return assign (__il.begin (), __il.size ());
12151216 }
12161217# endif
1217- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator =(const value_type* __s) {
1218+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1219+ operator =(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) {
12181220 return assign (__s);
12191221 }
12201222# if _LIBCPP_STD_VER >= 23
@@ -1340,7 +1342,8 @@ public:
13401342 return append (__sv);
13411343 }
13421344
1343- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator +=(const value_type* __s) {
1345+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1346+ operator +=(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) {
13441347 return append (__s);
13451348 }
13461349
@@ -1381,7 +1384,7 @@ public:
13811384 append (const _Tp& __t , size_type __pos, size_type __n = npos);
13821385
13831386 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append (const value_type* __s, size_type __n);
1384- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append (const value_type* __s);
1387+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append (const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);
13851388 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append (size_type __n, value_type __c);
13861389
13871390 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __append_default_init (size_type __n);
@@ -1539,7 +1542,7 @@ public:
15391542 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
15401543 insert (size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n = npos);
15411544 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert (size_type __pos, const value_type* __s, size_type __n);
1542- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert (size_type __pos, const value_type* __s);
1545+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert (size_type __pos, const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);
15431546 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert (size_type __pos, size_type __n, value_type __c);
15441547 _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert (const_iterator __pos, value_type __c);
15451548
@@ -1719,7 +1722,7 @@ public:
17191722 }
17201723
17211724 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1722- find (const value_type* __s, size_type __pos = 0 ) const _NOEXCEPT {
1725+ find (const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0 ) const _NOEXCEPT {
17231726 _LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::find(): received nullptr" );
17241727 return std::__str_find<value_type, size_type, traits_type, npos>(
17251728 data (), size (), __s, __pos, traits_type::length (__s));
@@ -1750,7 +1753,7 @@ public:
17501753 }
17511754
17521755 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1753- rfind (const value_type* __s, size_type __pos = npos) const _NOEXCEPT {
1756+ rfind (const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
17541757 _LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::rfind(): received nullptr" );
17551758 return std::__str_rfind<value_type, size_type, traits_type, npos>(
17561759 data (), size (), __s, __pos, traits_type::length (__s));
@@ -1783,7 +1786,7 @@ public:
17831786 }
17841787
17851788 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1786- find_first_of (const value_type* __s, size_type __pos = 0 ) const _NOEXCEPT {
1789+ find_first_of (const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0 ) const _NOEXCEPT {
17871790 _LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::find_first_of(): received nullptr" );
17881791 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(
17891792 data (), size (), __s, __pos, traits_type::length (__s));
@@ -1817,7 +1820,7 @@ public:
18171820 }
18181821
18191822 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1820- find_last_of (const value_type* __s, size_type __pos = npos) const _NOEXCEPT {
1823+ find_last_of (const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
18211824 _LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::find_last_of(): received nullptr" );
18221825 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(
18231826 data (), size (), __s, __pos, traits_type::length (__s));
@@ -1851,7 +1854,7 @@ public:
18511854 }
18521855
18531856 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1854- find_first_not_of (const value_type* __s, size_type __pos = 0 ) const _NOEXCEPT {
1857+ find_first_not_of (const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0 ) const _NOEXCEPT {
18551858 _LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::find_first_not_of(): received nullptr" );
18561859 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(
18571860 data (), size (), __s, __pos, traits_type::length (__s));
@@ -1885,7 +1888,7 @@ public:
18851888 }
18861889
18871890 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1888- find_last_not_of (const value_type* __s, size_type __pos = npos) const _NOEXCEPT {
1891+ find_last_not_of (const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
18891892 _LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::find_last_not_of(): received nullptr" );
18901893 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(
18911894 data (), size (), __s, __pos, traits_type::length (__s));
@@ -1933,12 +1936,13 @@ public:
19331936 return __self_view (*this ).substr (__pos1, __n1).compare (__sv.substr (__pos2, __n2));
19341937 }
19351938
1936- _LIBCPP_CONSTEXPR_SINCE_CXX20 int compare (const value_type* __s) const _NOEXCEPT {
1939+ _LIBCPP_CONSTEXPR_SINCE_CXX20 int compare (const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const _NOEXCEPT {
19371940 _LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::compare(): received nullptr" );
19381941 return compare (0 , npos, __s, traits_type::length (__s));
19391942 }
19401943
1941- _LIBCPP_CONSTEXPR_SINCE_CXX20 int compare (size_type __pos1, size_type __n1, const value_type* __s) const {
1944+ _LIBCPP_CONSTEXPR_SINCE_CXX20 int
1945+ compare (size_type __pos1, size_type __n1, const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const {
19421946 _LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::compare(): received nullptr" );
19431947 return compare (__pos1, __n1, __s, traits_type::length (__s));
19441948 }
@@ -1957,7 +1961,7 @@ public:
19571961 return !empty () && _Traits::eq (front (), __c);
19581962 }
19591963
1960- constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with (const value_type* __s) const noexcept {
1964+ constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with (const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const noexcept {
19611965 return starts_with (__self_view (__s));
19621966 }
19631967
@@ -1971,7 +1975,7 @@ public:
19711975 return !empty () && _Traits::eq (back (), __c);
19721976 }
19731977
1974- constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with (const value_type* __s) const noexcept {
1978+ constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with (const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const noexcept {
19751979 return ends_with (__self_view (__s));
19761980 }
19771981# endif
@@ -1987,7 +1991,7 @@ public:
19871991 return __self_view (typename __self_view::__assume_valid (), data (), size ()).contains (__c);
19881992 }
19891993
1990- constexpr _LIBCPP_HIDE_FROM_ABI bool contains (const value_type* __s) const {
1994+ constexpr _LIBCPP_HIDE_FROM_ABI bool contains (const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const {
19911995 return __self_view (typename __self_view::__assume_valid (), data (), size ()).contains (__s);
19921996 }
19931997# endif
0 commit comments