https://gcc.gnu.org/g:468124a1aa893c6cc8c460a519f9203a70518cf6

commit r16-7927-g468124a1aa893c6cc8c460a519f9203a70518cf6
Author: Tomasz Kamiński <[email protected]>
Date:   Fri Mar 6 08:00:05 2026 +0100

    libstdc++: Remove unnecessary string in filesystem::path formatter
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/fs_path.h (std::formatter<filesystem::path, _CharT>):
            Format _Utf_view directly via __formatter_str::_M_format_range.
    
    Reviewed-by: Jonathan Wakely <[email protected]>
    Signed-off-by: Tomasz Kamiński <[email protected]>

Diff:
---
 libstdc++-v3/include/bits/fs_path.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libstdc++-v3/include/bits/fs_path.h 
b/libstdc++-v3/include/bits/fs_path.h
index 5c0d5c9d5f1e..313c64bac43c 100644
--- a/libstdc++-v3/include/bits/fs_path.h
+++ b/libstdc++-v3/include/bits/fs_path.h
@@ -1543,9 +1543,8 @@ template<>
                  __sv = __sink.view();
                  __spec._M_debug = 0;
                }
-             basic_string<_CharT> __out_str
-               (std::from_range, __unicode::_Utf_view<_CharT, _ViewT>(__sv));
-             return _FmtStrT(__spec).format(__out_str, __fc);
+             return _FmtStrT(__spec)._M_format_range(
+                      __unicode::_Utf_view<_CharT, _ViewT>(__sv), __fc);
            }
        }

Reply via email to