From 0850f39fa957065e5790e0e380d2071d13ff77bf Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 5 Jul 2024 01:28:56 +0800 Subject: [PATCH] Implement LWG-3944 --- stl/inc/__msvc_formatter.hpp | 35 +++++++++++++++++++ .../test.compile.pass.cpp | 4 +++ 2 files changed, 39 insertions(+) diff --git a/stl/inc/__msvc_formatter.hpp b/stl/inc/__msvc_formatter.hpp index bcf1f6e689e..5ff1bea2f4b 100644 --- a/stl/inc/__msvc_formatter.hpp +++ b/stl/inc/__msvc_formatter.hpp @@ -271,6 +271,41 @@ struct formatter, _CharT> }; #if _HAS_CXX23 +template <> +struct formatter { + formatter() = delete; + formatter(const formatter&) = delete; + formatter& operator=(const formatter&) = delete; +}; + +template <> +struct formatter { + formatter() = delete; + formatter(const formatter&) = delete; + formatter& operator=(const formatter&) = delete; +}; + +template +struct formatter { + formatter() = delete; + formatter(const formatter&) = delete; + formatter& operator=(const formatter&) = delete; +}; + +template +struct formatter, wchar_t> { + formatter() = delete; + formatter(const formatter&) = delete; + formatter& operator=(const formatter&) = delete; +}; + +template +struct formatter, wchar_t> { + formatter() = delete; + formatter(const formatter&) = delete; + formatter& operator=(const formatter&) = delete; +}; + _EXPORT_STD enum class range_format { disabled, map, set, sequence, string, debug_string }; template diff --git a/tests/std/tests/P2286R8_text_formatting_formattable/test.compile.pass.cpp b/tests/std/tests/P2286R8_text_formatting_formattable/test.compile.pass.cpp index 3dd6fa18038..5ffea68fa60 100644 --- a/tests/std/tests/P2286R8_text_formatting_formattable/test.compile.pass.cpp +++ b/tests/std/tests/P2286R8_text_formatting_formattable/test.compile.pass.cpp @@ -269,7 +269,11 @@ enum class ec { a }; template void test_disabled() { if constexpr (!same_as) { + assert_is_not_formattable(); assert_is_not_formattable(); + assert_is_not_formattable(); + assert_is_not_formattable(); + assert_is_not_formattable(); } assert_is_not_formattable();