Skip to content

Commit 6669c47

Browse files
committed
[libc++] Fix missing nullptr detection annotation
`_LIBCPP_DIAGNOSE_NULLPTR` annotation was introduced to catch the misuse of APIs that take a pointer to a null-terminated string. Adding the missing annotation to one of the APIs.
1 parent e697c99 commit 6669c47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcxx/include/string

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ public:
10541054
basic_string(nullptr_t) = delete;
10551055
# endif
10561056

1057-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n) {
1057+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __n) {
10581058
_LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
10591059
__init(__s, __n);
10601060
}

0 commit comments

Comments
 (0)