diff --git a/stl/inc/ostream b/stl/inc/ostream index d335116daca..c064fff6766 100644 --- a/stl/inc/ostream +++ b/stl/inc/ostream @@ -912,15 +912,49 @@ basic_ostream& operator<<( } #ifdef __cpp_char8_t // These deleted overloads are specified in P1423. +// don't insert a UTF-8 NTBS template -basic_ostream& operator<<( - basic_ostream&, const char8_t*) = delete; // don't insert a UTF-8 NTBS +basic_ostream& operator<<(basic_ostream&, const char8_t*) = delete; +template +basic_ostream& operator<<(basic_ostream&, const char8_t*) = delete; +// don't insert a UTF-8 code unit template -basic_ostream& operator<<( - basic_ostream&, char8_t) = delete; // don't insert a UTF-8 code unit +basic_ostream& operator<<(basic_ostream&, char8_t) = delete; +template +basic_ostream& operator<<(basic_ostream&, char8_t) = delete; #endif // __cpp_char8_t +#if !_HAS_STREAM_INSERTION_OPERATORS_DELETED_IN_CXX20 +#ifdef _NATIVE_WCHAR_T_DEFINED +template +basic_ostream& operator<<(basic_ostream&, wchar_t) = delete; + +template +basic_ostream& operator<<(basic_ostream&, const wchar_t*) = delete; +#endif // _NATIVE_WCHAR_T_DEFINED + +template +basic_ostream& operator<<(basic_ostream&, char16_t) = delete; +template +basic_ostream& operator<<(basic_ostream&, char32_t) = delete; + +template +basic_ostream& operator<<(basic_ostream&, char16_t) = delete; +template +basic_ostream& operator<<(basic_ostream&, char32_t) = delete; + +template +basic_ostream& operator<<(basic_ostream&, const char16_t*) = delete; +template +basic_ostream& operator<<(basic_ostream&, const char32_t*) = delete; + +template +basic_ostream& operator<<(basic_ostream&, const char16_t*) = delete; +template +basic_ostream& operator<<(basic_ostream&, const char32_t*) = delete; +#endif // !_HAS_STREAM_INSERTION_OPERATORS_DELETED_IN_CXX20 + template struct _Can_stream_out : false_type {}; diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 60be7ce8fc5..017f515acef 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -172,6 +172,7 @@ // P1227R2 Signed std::ssize(), Unsigned span::size() // P1357R1 is_bounded_array, is_unbounded_array // P1394R4 Range Constructor For span +// P1423R3 char8_t Backward Compatibility Remediation // P1456R1 Move-Only Views // P1612R1 Relocating endian To // P1645R1 constexpr For Algorithms @@ -585,6 +586,12 @@ #endif // _M_FP_EXCEPT #endif // _STD_VECTORIZE_WITH_FLOAT_CONTROL +// P1423R3 char8_t Backward Compatibility Remediation +// Controls whether we allow the stream insertions this proposal forbids +#ifndef _HAS_STREAM_INSERTION_OPERATORS_DELETED_IN_CXX20 +#define _HAS_STREAM_INSERTION_OPERATORS_DELETED_IN_CXX20 (!_HAS_CXX20) +#endif // _HAS_STREAM_INSERTION_OPERATORS_DELETED_IN_CXX20 + // P0174R2 Deprecating Vestigial Library Parts // P0521R0 Deprecating shared_ptr::unique() // Other C++17 deprecation warnings @@ -1007,7 +1014,7 @@ #define __cpp_lib_bounded_array_traits 201902L #ifdef __cpp_char8_t -#define __cpp_lib_char8_t 201811L +#define __cpp_lib_char8_t 201907L #endif // __cpp_char8_t #if defined(__cpp_concepts) && __cpp_concepts > 201507L diff --git a/tests/libcxx/skipped_tests.txt b/tests/libcxx/skipped_tests.txt index 06d1868ba22..d22aec74a0d 100644 --- a/tests/libcxx/skipped_tests.txt +++ b/tests/libcxx/skipped_tests.txt @@ -51,6 +51,13 @@ containers\unord\unord.set\insert_and_emplace_allocator_requirements.pass.cpp # See https://reviews.llvm.org/D73138 containers\views\span.sub\subspan.pass.cpp +# libcxx doesn't yet implement P1423R3, so it expects an "old" value for __cpp_lib_char8_t +language.support\support.limits\support.limits.general\filesystem.version.pass.cpp +language.support\support.limits\support.limits.general\istream.version.pass.cpp +language.support\support.limits\support.limits.general\limits.version.pass.cpp +language.support\support.limits\support.limits.general\locale.version.pass.cpp +language.support\support.limits\support.limits.general\ostream.version.pass.cpp + # *** INTERACTIONS WITH CONTEST / C1XX THAT UPSTREAM LIKELY WON'T FIX *** # Tracked by VSO-593630 " Enable libcxx filesystem tests"