Index: libcxx/include/__format/format_error.h =================================================================== --- libcxx/include/__format/format_error.h +++ libcxx/include/__format/format_error.h @@ -28,6 +28,9 @@ : runtime_error(__s) {} _LIBCPP_HIDE_FROM_ABI explicit format_error(const char* __s) : runtime_error(__s) {} + + _LIBCPP_HIDE_FROM_ABI format_error(const format_error&) = default; + _LIBCPP_HIDE_FROM_ABI format_error& operator=(const format_error&) = default; // TODO FMT Remove when format is no longer experimental. // Avoids linker errors when building the Clang-cl Windows DLL which doesn't // support the experimental library. Index: libcxx/include/__functional/function.h =================================================================== --- libcxx/include/__functional/function.h +++ libcxx/include/__functional/function.h @@ -50,6 +50,9 @@ : public exception { public: + bad_function_call() = default; + bad_function_call(const bad_function_call&) = default; + bad_function_call& operator=(const bad_function_call&) = default; // Note that when a key function is not used, every translation unit that uses // bad_function_call will end up containing a weak definition of the vtable and // typeinfo. Index: libcxx/include/__memory/shared_ptr.h =================================================================== --- libcxx/include/__memory/shared_ptr.h +++ libcxx/include/__memory/shared_ptr.h @@ -111,6 +111,7 @@ public: bad_weak_ptr() _NOEXCEPT = default; bad_weak_ptr(const bad_weak_ptr&) _NOEXCEPT = default; + bad_weak_ptr& operator=(const bad_weak_ptr&) _NOEXCEPT = default; ~bad_weak_ptr() _NOEXCEPT override; const char* what() const _NOEXCEPT override; }; Index: libcxx/include/exception =================================================================== --- libcxx/include/exception +++ libcxx/include/exception @@ -287,8 +287,8 @@ exception_ptr __ptr_; public: nested_exception() _NOEXCEPT; -// nested_exception(const nested_exception&) noexcept = default; -// nested_exception& operator=(const nested_exception&) noexcept = default; + nested_exception(const nested_exception&) _NOEXCEPT = default; + nested_exception& operator=(const nested_exception&) _NOEXCEPT = default; virtual ~nested_exception() _NOEXCEPT; // access functions Index: libcxx/include/optional =================================================================== --- libcxx/include/optional +++ libcxx/include/optional @@ -193,6 +193,9 @@ : public exception { public: + bad_optional_access() _NOEXCEPT = default; + bad_optional_access(const bad_optional_access&) _NOEXCEPT = default; + bad_optional_access& operator=(const bad_optional_access&) _NOEXCEPT = default; // Get the key function ~bad_optional_access() into the dylib ~bad_optional_access() _NOEXCEPT override; const char* what() const _NOEXCEPT override; Index: libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/arrow.pass.cpp =================================================================== --- libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/arrow.pass.cpp +++ libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/arrow.pass.cpp @@ -50,6 +50,8 @@ int data_; public: B(int d=1) : data_(d) {} + B(const B&) = default; + B& operator=(const B&) = default; ~B() {data_ = -1;} int get() const {return data_;} Index: libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp =================================================================== --- libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp +++ libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp @@ -24,6 +24,9 @@ static std::function global; static bool cancel; + A() = default; + A(const A&) = default; + A& operator=(const A&) = default; ~A() { DoNotOptimize(cancel); if (cancel) Index: libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp =================================================================== --- libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp +++ libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp @@ -24,6 +24,9 @@ static std::function global; static bool cancel; + A() = default; + A(const A&) = default; + A& operator=(const A&) = default; ~A() { DoNotOptimize(cancel); if (cancel) Index: libcxx/test/std/iterators/predef.iterators/insert.iterators/back.insert.iter.ops/back.insert.iter.op=/lv_value.pass.cpp =================================================================== --- libcxx/test/std/iterators/predef.iterators/insert.iterators/back.insert.iter.ops/back.insert.iter.op=/lv_value.pass.cpp +++ libcxx/test/std/iterators/predef.iterators/insert.iterators/back.insert.iter.ops/back.insert.iter.op=/lv_value.pass.cpp @@ -37,6 +37,8 @@ int data_; public: Copyable() : data_(0) {} + Copyable(const Copyable&) = default; + Copyable& operator=(const Copyable&) = default; ~Copyable() {data_ = -1;} friend bool operator==(const Copyable& x, const Copyable& y) Index: libcxx/test/std/iterators/predef.iterators/insert.iterators/front.insert.iter.ops/front.insert.iter.op=/lv_value.pass.cpp =================================================================== --- libcxx/test/std/iterators/predef.iterators/insert.iterators/front.insert.iter.ops/front.insert.iter.op=/lv_value.pass.cpp +++ libcxx/test/std/iterators/predef.iterators/insert.iterators/front.insert.iter.ops/front.insert.iter.op=/lv_value.pass.cpp @@ -37,6 +37,8 @@ int data_; public: Copyable() : data_(0) {} + Copyable(const Copyable&) = default; + Copyable& operator=(const Copyable&) = default; ~Copyable() {data_ = -1;} friend bool operator==(const Copyable& x, const Copyable& y) Index: libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp =================================================================== --- libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp +++ libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp @@ -26,6 +26,8 @@ int data_; public: A() : data_(1) {} + A(const A&) = default; + A& operator=(const A&) = default; ~A() {data_ = -1;} friend bool operator==(const A& x, const A& y) Index: libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp =================================================================== --- libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp +++ libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp @@ -29,6 +29,8 @@ int data_; public: A() : data_(1) {} + A(const A&) = default; + A& operator=(const A&) = default; ~A() {data_ = -1;} int get() const {return data_;} @@ -50,6 +52,8 @@ int data_; public: B(int d=1) : data_(d) {} + B(const B&) = default; + B& operator=(const B&) = default; ~B() {data_ = -1;} int get() const {return data_;} Index: libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp =================================================================== --- libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp +++ libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp @@ -29,6 +29,9 @@ constexpr ForwardIter end() { return ForwardIter(buff + 8); } constexpr ForwardIter end() const { return ForwardIter(); } + ZeroOnDestroy() = default; + ZeroOnDestroy(const ZeroOnDestroy&) = default; + ZeroOnDestroy& operator=(const ZeroOnDestroy&) = default; ~ZeroOnDestroy() { std::memset(buff, 0, sizeof(buff)); } Index: libcxx/test/std/utilities/tuple/tuple.tuple/alloc_first.h =================================================================== --- libcxx/test/std/utilities/tuple/tuple.tuple/alloc_first.h +++ libcxx/test/std/utilities/tuple/tuple.tuple/alloc_first.h @@ -44,6 +44,9 @@ allocator_constructed = true; } + alloc_first(const alloc_first&) = default; + alloc_first& operator=(const alloc_first&) = default; + ~alloc_first() {data_ = -1;} friend bool operator==(const alloc_first& x, const alloc_first& y) Index: libcxx/test/std/utilities/tuple/tuple.tuple/alloc_last.h =================================================================== --- libcxx/test/std/utilities/tuple/tuple.tuple/alloc_last.h +++ libcxx/test/std/utilities/tuple/tuple.tuple/alloc_last.h @@ -44,6 +44,9 @@ allocator_constructed = true; } + alloc_last(const alloc_last&) = default; + alloc_last& operator=(const alloc_last&) = default; + ~alloc_last() {data_ = -1;} friend bool operator==(const alloc_last& x, const alloc_last& y) Index: libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp =================================================================== --- libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp +++ libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp @@ -26,6 +26,8 @@ struct B { int id_; explicit B(int i = 0) : id_(i) {} + B(const B&) = default; + B& operator=(const B&) = default; virtual ~B() {} }; Index: libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp =================================================================== --- libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp +++ libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp @@ -36,7 +36,8 @@ int id_; explicit B(int i) : id_(i) {} - + B(const B&) = default; + B& operator=(const B&) = default; virtual ~B() {} }; Index: libcxx/test/support/counting_predicates.h =================================================================== --- libcxx/test/support/counting_predicates.h +++ libcxx/test/support/counting_predicates.h @@ -20,6 +20,8 @@ typedef bool result_type; unary_counting_predicate(Predicate p) : p_(p), count_(0) {} + unary_counting_predicate(const unary_counting_predicate&) = default; + unary_counting_predicate& operator=(const unary_counting_predicate&) = default; ~unary_counting_predicate() {} bool operator () (const Arg &a) const { ++count_; return p_(a); } Index: libcxx/test/support/deleter_types.h =================================================================== --- libcxx/test/support/deleter_types.h +++ libcxx/test/support/deleter_types.h @@ -164,6 +164,10 @@ public: TEST_CONSTEXPR_CXX23 CDeleter() : state_(0) {} TEST_CONSTEXPR_CXX23 explicit CDeleter(int s) : state_(s) {} + + TEST_CONSTEXPR_CXX23 CDeleter(const CDeleter&) = default; + TEST_CONSTEXPR_CXX23 CDeleter& operator=(const CDeleter&) = default; + TEST_CONSTEXPR_CXX23 ~CDeleter() { assert(state_ >= 0); state_ = -1; @@ -188,6 +192,9 @@ template TEST_CONSTEXPR_CXX23 CDeleter(const CDeleter& d) : state_(d.state()) {} + TEST_CONSTEXPR_CXX23 CDeleter(const CDeleter&) = default; + TEST_CONSTEXPR_CXX23 CDeleter& operator=(const CDeleter&) = default; + TEST_CONSTEXPR_CXX23 ~CDeleter() { assert(state_ >= 0); state_ = -1; Index: libcxx/test/support/nasty_containers.h =================================================================== --- libcxx/test/support/nasty_containers.h +++ libcxx/test/support/nasty_containers.h @@ -41,6 +41,8 @@ #if TEST_STD_VER >= 11 nasty_vector(std::initializer_list il) : v_(il) {} #endif + nasty_vector(const nasty_vector&) = default; + nasty_vector& operator=(const nasty_vector&) = default; ~nasty_vector() {} template Index: libcxx/utils/libcxx/test/params.py =================================================================== --- libcxx/utils/libcxx/test/params.py +++ libcxx/utils/libcxx/test/params.py @@ -51,6 +51,7 @@ '-Wunused-parameter', '-Wunreachable-code', '-Wno-unused-local-typedef', + '-Wdeprecated-copy-with-user-provided-dtor', ] _allStandards = ['c++03', 'c++11', 'c++14', 'c++17', 'c++20', 'c++2b']