Remove cause of "whitespace in literal operator" warning in Clang 20#61
Merged
martinmoene merged 1 commit intononstd-lite:masterfrom Mar 24, 2025
Conversation
When string-view lite is compiled with Clang 20, it emits the
following deprecation warnings:
/__w/string-view-lite/string-view-lite/include/nonstd/string_view.hpp:1539:57: warning: identifier '_sv' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
1539 | nssv_constexpr nonstd::sv_lite::string_view operator "" _sv( const char* str, size_t len ) nssv_noexcept // (1)
| ~~~~~~~~~~~~^~~
| operator""_sv
/__w/string-view-lite/string-view-lite/include/nonstd/string_view.hpp:1544:60: warning: identifier '_sv' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
1544 | nssv_constexpr nonstd::sv_lite::u16string_view operator "" _sv( const char16_t* str, size_t len ) nssv_noexcept // (2)
| ~~~~~~~~~~~~^~~
| operator""_sv
/__w/string-view-lite/string-view-lite/include/nonstd/string_view.hpp:1549:60: warning: identifier '_sv' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
1549 | nssv_constexpr nonstd::sv_lite::u32string_view operator "" _sv( const char32_t* str, size_t len ) nssv_noexcept // (3)
| ~~~~~~~~~~~~^~~
| operator""_sv
/__w/string-view-lite/string-view-lite/include/nonstd/string_view.hpp:1554:58: warning: identifier '_sv' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
1554 | nssv_constexpr nonstd::sv_lite::wstring_view operator "" _sv( const wchar_t* str, size_t len ) nssv_noexcept // (4)
| ~~~~~~~~~~~~^~~
| operator""_sv
To fix that problem the space characters in the literal operator declarations are removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When string-view lite is compiled with Clang 20, it emits the following deprecation warnings:
An example of that can be seen in this workflow run in the "Build tests" step.
To fix that problem the space characters in the literal operator declarations are removed.