@@ -1037,13 +1037,14 @@ public:
1037
1037
# endif // _LIBCPP_CXX03_LANG
1038
1038
1039
1039
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) {
1041
1041
_LIBCPP_ASSERT_NON_NULL (__s != nullptr , " basic_string(const char*) detected nullptr" );
1042
1042
__init (__s, traits_type::length (__s));
1043
1043
}
1044
1044
1045
1045
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)
1047
1048
: __alloc_(__a) {
1048
1049
_LIBCPP_ASSERT_NON_NULL (__s != nullptr , " basic_string(const char*, allocator) detected nullptr" );
1049
1050
__init (__s, traits_type::length (__s));
@@ -1214,7 +1215,8 @@ public:
1214
1215
return assign (__il.begin (), __il.size ());
1215
1216
}
1216
1217
# 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) {
1218
1220
return assign (__s);
1219
1221
}
1220
1222
# if _LIBCPP_STD_VER >= 23
@@ -1340,7 +1342,8 @@ public:
1340
1342
return append (__sv);
1341
1343
}
1342
1344
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) {
1344
1347
return append (__s);
1345
1348
}
1346
1349
@@ -1381,7 +1384,7 @@ public:
1381
1384
append (const _Tp& __t , size_type __pos, size_type __n = npos);
1382
1385
1383
1386
_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);
1385
1388
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append (size_type __n, value_type __c);
1386
1389
1387
1390
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __append_default_init (size_type __n);
@@ -1539,7 +1542,7 @@ public:
1539
1542
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1540
1543
insert (size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n = npos);
1541
1544
_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);
1543
1546
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert (size_type __pos, size_type __n, value_type __c);
1544
1547
_LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert (const_iterator __pos, value_type __c);
1545
1548
@@ -1719,7 +1722,7 @@ public:
1719
1722
}
1720
1723
1721
1724
_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 {
1723
1726
_LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::find(): received nullptr" );
1724
1727
return std::__str_find<value_type, size_type, traits_type, npos>(
1725
1728
data (), size (), __s, __pos, traits_type::length (__s));
@@ -1750,7 +1753,7 @@ public:
1750
1753
}
1751
1754
1752
1755
_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 {
1754
1757
_LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::rfind(): received nullptr" );
1755
1758
return std::__str_rfind<value_type, size_type, traits_type, npos>(
1756
1759
data (), size (), __s, __pos, traits_type::length (__s));
@@ -1783,7 +1786,7 @@ public:
1783
1786
}
1784
1787
1785
1788
_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 {
1787
1790
_LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::find_first_of(): received nullptr" );
1788
1791
return std::__str_find_first_of<value_type, size_type, traits_type, npos>(
1789
1792
data (), size (), __s, __pos, traits_type::length (__s));
@@ -1817,7 +1820,7 @@ public:
1817
1820
}
1818
1821
1819
1822
_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 {
1821
1824
_LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::find_last_of(): received nullptr" );
1822
1825
return std::__str_find_last_of<value_type, size_type, traits_type, npos>(
1823
1826
data (), size (), __s, __pos, traits_type::length (__s));
@@ -1851,7 +1854,7 @@ public:
1851
1854
}
1852
1855
1853
1856
_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 {
1855
1858
_LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::find_first_not_of(): received nullptr" );
1856
1859
return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(
1857
1860
data (), size (), __s, __pos, traits_type::length (__s));
@@ -1885,7 +1888,7 @@ public:
1885
1888
}
1886
1889
1887
1890
_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 {
1889
1892
_LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::find_last_not_of(): received nullptr" );
1890
1893
return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(
1891
1894
data (), size (), __s, __pos, traits_type::length (__s));
@@ -1933,12 +1936,13 @@ public:
1933
1936
return __self_view (*this ).substr (__pos1, __n1).compare (__sv.substr (__pos2, __n2));
1934
1937
}
1935
1938
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 {
1937
1940
_LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::compare(): received nullptr" );
1938
1941
return compare (0 , npos, __s, traits_type::length (__s));
1939
1942
}
1940
1943
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 {
1942
1946
_LIBCPP_ASSERT_NON_NULL (__s != nullptr , " string::compare(): received nullptr" );
1943
1947
return compare (__pos1, __n1, __s, traits_type::length (__s));
1944
1948
}
@@ -1957,7 +1961,7 @@ public:
1957
1961
return !empty () && _Traits::eq (front (), __c);
1958
1962
}
1959
1963
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 {
1961
1965
return starts_with (__self_view (__s));
1962
1966
}
1963
1967
@@ -1971,7 +1975,7 @@ public:
1971
1975
return !empty () && _Traits::eq (back (), __c);
1972
1976
}
1973
1977
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 {
1975
1979
return ends_with (__self_view (__s));
1976
1980
}
1977
1981
# endif
@@ -1987,7 +1991,7 @@ public:
1987
1991
return __self_view (typename __self_view::__assume_valid (), data (), size ()).contains (__c);
1988
1992
}
1989
1993
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 {
1991
1995
return __self_view (typename __self_view::__assume_valid (), data (), size ()).contains (__s);
1992
1996
}
1993
1997
# endif
0 commit comments