This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new eebff8b7d3 -std=c++20: Remove TextView space before _sv/_tv literal 
(#12164)
eebff8b7d3 is described below

commit eebff8b7d34b0899b02592393bc8b7827ff5597e
Author: Brian Neradt <[email protected]>
AuthorDate: Mon Apr 7 15:36:50 2025 -0500

    -std=c++20: Remove TextView space before _sv/_tv literal (#12164)
    
    Spaces before _sv literals in operator"" declarations are deprecated for
    -std=c++20. This removes those spaces in the TextView.h declarations.
    
    This addresses the following warning:
    
    ```
    include/swoc/TextView.h:2088:12: error: identifier '_sv' preceded by 
whitespace in a literal operator declaration is deprecated 
[-Werror,-Wdeprecated-literal-operator]
     2088 | operator"" _sv(const char *s, size_t n) {
          | ~~~~~~~~~~~^~~
          | operator""_sv
    include/swoc/TextView.h:2103:12: error: identifier '_tv' preceded by 
whitespace in a literal operator declaration is deprecated 
[-Werror,-Wdeprecated-literal-operator]
     2103 | operator"" _tv(const char *s, size_t n) {
          | ~~~~~~~~~~~^~~
          | operator""_tv
    ```
---
 lib/swoc/include/swoc/TextView.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/swoc/include/swoc/TextView.h b/lib/swoc/include/swoc/TextView.h
index 3fecf0315b..ed017da673 100644
--- a/lib/swoc/include/swoc/TextView.h
+++ b/lib/swoc/include/swoc/TextView.h
@@ -2085,7 +2085,7 @@ namespace literals {
  * so hopefully someday this can be removed.
  */
 constexpr std::string_view
-operator"" _sv(const char *s, size_t n) {
+operator""_sv(const char *s, size_t n) {
   return {s, n};
 }
 
@@ -2100,7 +2100,7 @@ operator"" _sv(const char *s, size_t n) {
  * so hopefully someday this can be removed.
  */
 constexpr swoc::TextView
-operator"" _tv(const char *s, size_t n) {
+operator""_tv(const char *s, size_t n) {
   return {s, n};
 }
 } // namespace literals

Reply via email to