From 28457a8b9fd621e090202c6ca3bef3d3ad611255 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Sun, 21 May 2023 16:40:01 +0700 Subject: [PATCH 1/6] remove `operator>>` for `istream >> setfill(c)` --- stl/inc/iomanip | 9 --------- 1 file changed, 9 deletions(-) diff --git a/stl/inc/iomanip b/stl/inc/iomanip index 60a049221ab..8884dc94bae 100644 --- a/stl/inc/iomanip +++ b/stl/inc/iomanip @@ -25,15 +25,6 @@ template struct _Fillobj { // store fill character _Fillobj(_Elem _Ch) : _Fill(_Ch) {} - template - friend basic_istream<_Elem2, _Traits>& operator>>(basic_istream<_Elem2, _Traits>& _Istr, const _Fillobj& _Manip) { - // set fill character in input stream - static_assert(is_same_v<_Elem, _Elem2>, "wrong character type for setfill"); - - _Istr.fill(_Manip._Fill); - return _Istr; - } - template friend basic_ostream<_Elem2, _Traits>& operator<<(basic_ostream<_Elem2, _Traits>& _Ostr, const _Fillobj& _Manip) { // set fill character in output stream From 74372c11956aa292436b555fd4455a177d17d8ad Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Sun, 21 May 2023 17:15:11 +0700 Subject: [PATCH 2/6] fix tests --- .../test.compile.pass.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp index 39008f01464..d870a24ef44 100644 --- a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp @@ -572,15 +572,17 @@ void future_test() { #endif // _M_CEE_PURE template -void iomanip_test_impl(IoManipIn in, IoManipOut out) { +void iomanip_test_impl(IoManipIn in, IoManipOut out, bool test_mainp_out = true) { stringstream ss{}; ss << in; - ss >> out; + if (test_input_stream) { + ss >> out; + } } template -void iomanip_test_impl(IoManip iom) { - iomanip_test_impl(iom, iom); +void iomanip_test_impl(IoManip iom, bool test_mainp_out = true) { + iomanip_test_impl(iom, iom, test_mainp_out); } void iomanip_test() { @@ -591,7 +593,7 @@ void iomanip_test() { localtime_s(&time, &t); string str = "string with \" quotes "; - iomanip_test_impl(sf); + iomanip_test_impl(sf, false); iomanip_test_impl(put_money(money), get_money(money)); iomanip_test_impl(put_time(&time, "%c %Z"), get_time(&time, "%c %Z")); iomanip_test_impl(quoted(str.c_str()), quoted(str)); From 759c828a4158b84ab63d9fa0ab8e46b489bd9646 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Sun, 21 May 2023 17:18:01 +0700 Subject: [PATCH 3/6] fix a typo --- .../test.compile.pass.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp index d870a24ef44..82508f6b7d5 100644 --- a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp @@ -572,7 +572,7 @@ void future_test() { #endif // _M_CEE_PURE template -void iomanip_test_impl(IoManipIn in, IoManipOut out, bool test_mainp_out = true) { +void iomanip_test_impl(IoManipIn in, IoManipOut out, bool test_manip_out = true) { stringstream ss{}; ss << in; if (test_input_stream) { @@ -581,7 +581,7 @@ void iomanip_test_impl(IoManipIn in, IoManipOut out, bool test_mainp_out = true) } template -void iomanip_test_impl(IoManip iom, bool test_mainp_out = true) { +void iomanip_test_impl(IoManip iom, bool test_manip_out = true) { iomanip_test_impl(iom, iom, test_mainp_out); } From 54e4602c3bccc3ae5a8a0b8ac38177d945342f43 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Sun, 21 May 2023 17:19:14 +0700 Subject: [PATCH 4/6] typo again --- .../test.compile.pass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp index 82508f6b7d5..ef37e795275 100644 --- a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp @@ -575,7 +575,7 @@ template void iomanip_test_impl(IoManipIn in, IoManipOut out, bool test_manip_out = true) { stringstream ss{}; ss << in; - if (test_input_stream) { + if (test_manip_out) { ss >> out; } } From 9f2fca9a3ac85851714f17af8250fc02e35044c3 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Sun, 21 May 2023 17:27:50 +0700 Subject: [PATCH 5/6] real fix tests --- .../test.compile.pass.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp index ef37e795275..e4eb7d6b1db 100644 --- a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp @@ -572,17 +572,21 @@ void future_test() { #endif // _M_CEE_PURE template -void iomanip_test_impl(IoManipIn in, IoManipOut out, bool test_manip_out = true) { +void iomanip_test_impl(IoManipIn in, IoManipOut out) { stringstream ss{}; ss << in; - if (test_manip_out) { - ss >> out; - } + ss >> out; +} + +template +void iomanip_test_impl(IoManip iom) { + iomanip_test_impl(iom, iom); } template -void iomanip_test_impl(IoManip iom, bool test_manip_out = true) { - iomanip_test_impl(iom, iom, test_mainp_out); +void iomanip_test_impl_for_setfill(IoManip in) { + stringstream ss{}; + ss << in; } void iomanip_test() { @@ -593,7 +597,7 @@ void iomanip_test() { localtime_s(&time, &t); string str = "string with \" quotes "; - iomanip_test_impl(sf, false); + iomanip_test_impl_for_setfill(sf); iomanip_test_impl(put_money(money), get_money(money)); iomanip_test_impl(put_time(&time, "%c %Z"), get_time(&time, "%c %Z")); iomanip_test_impl(quoted(str.c_str()), quoted(str)); From a36444944e0a789ae93339891619bfb4e61d32ce Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 25 May 2023 09:30:25 -0700 Subject: [PATCH 6/6] Flip in/out. --- .../test.compile.pass.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp index e4eb7d6b1db..7ade4b41b17 100644 --- a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp @@ -571,11 +571,11 @@ void future_test() { } #endif // _M_CEE_PURE -template -void iomanip_test_impl(IoManipIn in, IoManipOut out) { +template +void iomanip_test_impl(IoManipOut out, IoManipIn in) { stringstream ss{}; - ss << in; - ss >> out; + ss << out; + ss >> in; } template @@ -584,9 +584,9 @@ void iomanip_test_impl(IoManip iom) { } template -void iomanip_test_impl_for_setfill(IoManip in) { +void iomanip_test_impl_for_setfill(IoManip out) { stringstream ss{}; - ss << in; + ss << out; } void iomanip_test() {