diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -554,11 +554,11 @@ template <> struct hash; template <> struct hash; -basic_string operator "" s( const char *str, size_t len ); // C++14, constexpr since C++20 -basic_string operator "" s( const wchar_t *str, size_t len ); // C++14, constexpr since C++20 -constexpr basic_string operator "" s( const char8_t *str, size_t len ); // C++20 -basic_string operator "" s( const char16_t *str, size_t len ); // C++14, constexpr since C++20 -basic_string operator "" s( const char32_t *str, size_t len ); // C++14, constexpr since C++20 +basic_string operator""s( const char *str, size_t len ); // C++14, constexpr since C++20 +basic_string operator""s( const wchar_t *str, size_t len ); // C++14, constexpr since C++20 +constexpr basic_string operator""s( const char8_t *str, size_t len ); // C++20 +basic_string operator""s( const char16_t *str, size_t len ); // C++14, constexpr since C++20 +basic_string operator""s( const char32_t *str, size_t len ); // C++14, constexpr since C++20 } // std @@ -4371,14 +4371,14 @@ inline namespace string_literals { inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - basic_string operator "" s( const char *__str, size_t __len ) + basic_string operator""s( const char *__str, size_t __len ) { return basic_string (__str, __len); } #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - basic_string operator "" s( const wchar_t *__str, size_t __len ) + basic_string operator""s( const wchar_t *__str, size_t __len ) { return basic_string (__str, __len); } @@ -4386,20 +4386,20 @@ #ifndef _LIBCPP_HAS_NO_CHAR8_T inline _LIBCPP_HIDE_FROM_ABI constexpr - basic_string operator "" s(const char8_t *__str, size_t __len) + basic_string operator""s(const char8_t *__str, size_t __len) { return basic_string (__str, __len); } #endif inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - basic_string operator "" s( const char16_t *__str, size_t __len ) + basic_string operator""s( const char16_t *__str, size_t __len ) { return basic_string (__str, __len); } inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - basic_string operator "" s( const char32_t *__str, size_t __len ) + basic_string operator""s( const char32_t *__str, size_t __len ) { return basic_string (__str, __len); } diff --git a/libcxx/include/string_view b/libcxx/include/string_view --- a/libcxx/include/string_view +++ b/libcxx/include/string_view @@ -191,11 +191,11 @@ template <> struct hash; template <> struct hash; - constexpr basic_string_view operator "" sv(const char *str, size_t len) noexcept; - constexpr basic_string_view operator "" sv(const wchar_t *str, size_t len) noexcept; - constexpr basic_string_view operator "" sv(const char8_t *str, size_t len) noexcept; // C++20 - constexpr basic_string_view operator "" sv(const char16_t *str, size_t len) noexcept; - constexpr basic_string_view operator "" sv(const char32_t *str, size_t len) noexcept; + constexpr basic_string_view operator""sv(const char *str, size_t len) noexcept; + constexpr basic_string_view operator""sv(const wchar_t *str, size_t len) noexcept; + constexpr basic_string_view operator""sv(const char8_t *str, size_t len) noexcept; // C++20 + constexpr basic_string_view operator""sv(const char16_t *str, size_t len) noexcept; + constexpr basic_string_view operator""sv(const char32_t *str, size_t len) noexcept; } // namespace std @@ -1015,14 +1015,14 @@ inline namespace string_view_literals { inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - basic_string_view operator "" sv(const char *__str, size_t __len) _NOEXCEPT + basic_string_view operator""sv(const char *__str, size_t __len) _NOEXCEPT { return basic_string_view (__str, __len); } #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - basic_string_view operator "" sv(const wchar_t *__str, size_t __len) _NOEXCEPT + basic_string_view operator""sv(const wchar_t *__str, size_t __len) _NOEXCEPT { return basic_string_view (__str, __len); } @@ -1030,20 +1030,20 @@ #ifndef _LIBCPP_HAS_NO_CHAR8_T inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - basic_string_view operator "" sv(const char8_t *__str, size_t __len) _NOEXCEPT + basic_string_view operator""sv(const char8_t *__str, size_t __len) _NOEXCEPT { return basic_string_view (__str, __len); } #endif inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - basic_string_view operator "" sv(const char16_t *__str, size_t __len) _NOEXCEPT + basic_string_view operator""sv(const char16_t *__str, size_t __len) _NOEXCEPT { return basic_string_view (__str, __len); } inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - basic_string_view operator "" sv(const char32_t *__str, size_t __len) _NOEXCEPT + basic_string_view operator""sv(const char32_t *__str, size_t __len) _NOEXCEPT { return basic_string_view (__str, __len); } diff --git a/libcxx/modules/std/string_view.cppm b/libcxx/modules/std/string_view.cppm --- a/libcxx/modules/std/string_view.cppm +++ b/libcxx/modules/std/string_view.cppm @@ -42,7 +42,7 @@ inline namespace literals { inline namespace string_view_literals { // [string.view.literals], suffix for basic_string_view literals - using std::literals::string_view_literals::operator"" sv; + using std::literals::string_view_literals::operator""sv; } // namespace string_view_literals } // namespace literals } // namespace std