From 9afc914809ca90d03a9a8f53c439ebf4c62cf544 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Sat, 14 Jan 2023 15:41:58 +0000 Subject: libstdc++: Fix ostream insertion operators for calendar types libstdc++-v3/ChangeLog: * include/bits/chrono_io.h (operator<<): Fix syntax errors. * testsuite/std/time/month_day/io.cc: New test. * testsuite/std/time/month_day_last/io.cc: New test. * testsuite/std/time/month_weekday/io.cc: New test. * testsuite/std/time/month_weekday_last/io.cc: New test. * testsuite/std/time/weekday_indexed/io.cc: New test. * testsuite/std/time/weekday_last/io.cc: New test. * testsuite/std/time/year_month/io.cc: New test. * testsuite/std/time/year_month_day_last/io.cc: New test. * testsuite/std/time/year_month_weekday/io.cc: New test. * testsuite/std/time/year_month_weekday_last/io.cc: New test. --- libstdc++-v3/include/bits/chrono_io.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'libstdc++-v3/include') diff --git a/libstdc++-v3/include/bits/chrono_io.h b/libstdc++-v3/include/bits/chrono_io.h index 4e53cd4..87caa30 100644 --- a/libstdc++-v3/include/bits/chrono_io.h +++ b/libstdc++-v3/include/bits/chrono_io.h @@ -2134,7 +2134,7 @@ namespace chrono // either "{:L}[{}]" or "{:L}[{} is not a valid index]". The {:L} spec // means to format the weekday using ostringstream, so just do that. basic_stringstream<_CharT> __os2; - __os2.imbue(__os.getloc); + __os2.imbue(__os.getloc()); __os2 << __wdi.weekday(); const auto __i = __wdi.index(); if constexpr (is_same_v<_CharT, char>) @@ -2157,7 +2157,7 @@ namespace chrono { // As above, just write straight to a stringstream, as if by "{:L}[last]" basic_stringstream<_CharT> __os2; - __os2.imbue(__os.getloc); + __os2.imbue(__os.getloc()); __os2 << __wdl.weekday() << _GLIBCXX_WIDEN("[last]"); __os << __os2.view(); return __os; @@ -2169,7 +2169,7 @@ namespace chrono { // As above, just write straight to a stringstream, as if by "{:L}/{}" basic_stringstream<_CharT> __os2; - __os2.imbue(__os.getloc); + __os2.imbue(__os.getloc()); __os2 << __md.month(); if constexpr (is_same_v<_CharT, char>) __os2 << '/'; @@ -2189,7 +2189,7 @@ namespace chrono { // As above, just write straight to a stringstream, as if by "{:L}/last" basic_stringstream<_CharT> __os2; - __os2.imbue(__os.getloc); + __os2.imbue(__os.getloc()); __os2 << __mdl.month(); if constexpr (is_same_v<_CharT, char>) __os2 << "/last"; @@ -2206,7 +2206,7 @@ namespace chrono { // As above, just write straight to a stringstream, as if by "{:L}/{:L}" basic_stringstream<_CharT> __os2; - __os2.imbue(__os.getloc); + __os2.imbue(__os.getloc()); __os2 << __mwd.month(); if constexpr (is_same_v<_CharT, char>) __os2 << '/'; @@ -2224,7 +2224,7 @@ namespace chrono { // As above, just write straight to a stringstream, as if by "{:L}/{:L}" basic_stringstream<_CharT> __os2; - __os2.imbue(__os.getloc); + __os2.imbue(__os.getloc()); __os2 << __mwdl.month(); if constexpr (is_same_v<_CharT, char>) __os2 << '/'; @@ -2241,7 +2241,7 @@ namespace chrono { // As above, just write straight to a stringstream, as if by "{}/{:L}" basic_stringstream<_CharT> __os2; - __os2.imbue(__os.getloc); + __os2.imbue(__os.getloc()); __os2 << __ym.year(); if constexpr (is_same_v<_CharT, char>) __os2 << '/'; @@ -2277,7 +2277,7 @@ namespace chrono { // As above, just write straight to a stringstream, as if by "{}/{:L}" basic_stringstream<_CharT> __os2; - __os2.imbue(__os.getloc); + __os2.imbue(__os.getloc()); __os2 << __ymdl.year(); if constexpr (is_same_v<_CharT, char>) __os2 << '/'; @@ -2296,7 +2296,7 @@ namespace chrono // As above, just write straight to a stringstream, as if by // "{}/{:L}/{:L}" basic_stringstream<_CharT> __os2; - __os2.imbue(__os.getloc); + __os2.imbue(__os.getloc()); _CharT __slash; if constexpr (is_same_v<_CharT, char>) __slash = '/'; @@ -2316,7 +2316,7 @@ namespace chrono // As above, just write straight to a stringstream, as if by // "{}/{:L}/{:L}" basic_stringstream<_CharT> __os2; - __os2.imbue(__os.getloc); + __os2.imbue(__os.getloc()); _CharT __slash; if constexpr (is_same_v<_CharT, char>) __slash = '/'; -- cgit v1.1