https://gcc.gnu.org/g:cc8c7e44145deb457dbe436cf8b5bd88da0a9ec3

commit r13-9120-gcc8c7e44145deb457dbe436cf8b5bd88da0a9ec3
Author: Jonathan Wakely <[email protected]>
Date:   Fri Sep 27 16:54:31 2024 +0100

    libstdc++: Tweak %c formatting for chrono types
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/chrono_io.h (__formatter_chrono::_M_c): Add
            [[unlikely]] attribute to condition for missing %c format in
            locale. Use %T instead of %H:%M:%S in fallback.
    
    (cherry picked from commit ce89d2f3170e0d6474cee2c5cb9d478426a5b2f6)

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

diff --git a/libstdc++-v3/include/bits/chrono_io.h 
b/libstdc++-v3/include/bits/chrono_io.h
index 37ede63a53eb..db46bfc68e87 100644
--- a/libstdc++-v3/include/bits/chrono_io.h
+++ b/libstdc++-v3/include/bits/chrono_io.h
@@ -794,8 +794,8 @@ namespace __format
          const _CharT* __formats[2];
          __tp._M_date_time_formats(__formats);
          const _CharT* __rep = __formats[__mod];
-         if (!*__rep)
-           __rep = _GLIBCXX_WIDEN("%a %b %e %H:%M:%S %Y");
+         if (!*__rep) [[unlikely]]
+           __rep = _GLIBCXX_WIDEN("%a %b %e %T %Y");
          basic_string<_CharT> __fmt(_S_empty_spec);
          __fmt.insert(1u, 1u, _S_colon);
          __fmt.insert(2u, __rep);

Reply via email to