diff --git a/libcxx/include/__format/format_context.h b/libcxx/include/__format/format_context.h --- a/libcxx/include/__format/format_context.h +++ b/libcxx/include/__format/format_context.h @@ -85,9 +85,6 @@ template using formatter_type = formatter<_Tp, _CharT>; - basic_format_context(const basic_format_context&) = delete; - basic_format_context& operator=(const basic_format_context&) = delete; - _LIBCPP_HIDE_FROM_ABI basic_format_arg arg(size_t __id) const noexcept { return __args_.get(__id); diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp @@ -28,23 +28,13 @@ #include "test_basic_format_arg.h" #include "test_format_context.h" +#include "test_iterators.h" #include "make_string.h" #include "platform_support.h" // locale name macros #include "test_macros.h" template void test() { - static_assert( - !std::is_copy_constructible_v>); - static_assert( - !std::is_copy_assignable_v>); - // The move operations are implicitly deleted due to the - // deleted copy operations. - static_assert( - !std::is_move_constructible_v>); - static_assert( - !std::is_move_assignable_v>); - std::basic_string string = MAKE_STRING(CharT, "string"); // The type of the object is an exposition only type. The temporary is needed // to extend the lifetype of the object since args stores a pointer to the @@ -118,6 +108,20 @@ #endif } +// std::back_insert_iterator, copyable +static_assert(std::is_copy_constructible_v, char>>); +static_assert(std::is_copy_assignable_v, char>>); + +static_assert(std::is_move_constructible_v, char>>); +static_assert(std::is_move_assignable_v, char>>); + +// cpp20_output_iterator, move only +static_assert(!std::is_copy_constructible_v, char>>); +static_assert(!std::is_copy_assignable_v, char>>); + +static_assert(std::is_move_constructible_v, char>>); +static_assert(std::is_move_assignable_v, char>>); + int main(int, char**) { test>, char>(); #ifndef TEST_HAS_NO_WIDE_CHARACTERS