Index: libcxx/include/__format/format_error.h =================================================================== --- libcxx/include/__format/format_error.h +++ libcxx/include/__format/format_error.h @@ -28,6 +28,8 @@ : 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: + _LIBCPP_HIDE_FROM_ABI bad_function_call() _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI bad_function_call(const bad_function_call&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI bad_function_call& operator=(const bad_function_call&) _NOEXCEPT = 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 @@ -154,6 +154,7 @@ public: _LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {} _LIBCPP_INLINE_VISIBILITY exception(const exception&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI exception& operator=(const exception&) _NOEXCEPT = default; virtual ~exception() _NOEXCEPT; virtual const char* what() const _NOEXCEPT; @@ -162,6 +163,8 @@ class _LIBCPP_EXCEPTION_ABI bad_exception : public exception { public: _LIBCPP_INLINE_VISIBILITY bad_exception() _NOEXCEPT {} + _LIBCPP_HIDE_FROM_ABI bad_exception(const bad_exception&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI bad_exception& operator=(const bad_exception&) _NOEXCEPT = default; ~bad_exception() _NOEXCEPT override; const char* what() const _NOEXCEPT override; }; @@ -287,8 +290,8 @@ exception_ptr __ptr_; public: nested_exception() _NOEXCEPT; -// nested_exception(const nested_exception&) noexcept = default; -// nested_exception& operator=(const nested_exception&) noexcept = default; + _LIBCPP_HIDE_FROM_ABI nested_exception(const nested_exception&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI nested_exception& operator=(const nested_exception&) _NOEXCEPT = default; virtual ~nested_exception() _NOEXCEPT; // access functions Index: libcxx/include/new =================================================================== --- libcxx/include/new +++ libcxx/include/new @@ -131,6 +131,8 @@ { public: bad_alloc() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI bad_alloc(const bad_alloc&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI bad_alloc& operator=(const bad_alloc&) _NOEXCEPT = default; ~bad_alloc() _NOEXCEPT override; const char* what() const _NOEXCEPT override; }; @@ -140,6 +142,8 @@ { public: bad_array_new_length() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI bad_array_new_length(const bad_array_new_length&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI bad_array_new_length& operator=(const bad_array_new_length&) _NOEXCEPT = default; ~bad_array_new_length() _NOEXCEPT override; const char* what() const _NOEXCEPT override; }; Index: libcxx/include/optional =================================================================== --- libcxx/include/optional +++ libcxx/include/optional @@ -193,6 +193,9 @@ : public exception { public: + _LIBCPP_HIDE_FROM_ABI bad_optional_access() _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI bad_optional_access(const bad_optional_access&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI 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/include/stdexcept =================================================================== --- libcxx/include/stdexcept +++ libcxx/include/stdexcept @@ -129,6 +129,7 @@ #ifndef _LIBCPP_ABI_VCRUNTIME domain_error(const domain_error&) _NOEXCEPT = default; + domain_error& operator=(const domain_error&) _NOEXCEPT = default; ~domain_error() _NOEXCEPT override; #endif }; @@ -142,6 +143,7 @@ #ifndef _LIBCPP_ABI_VCRUNTIME invalid_argument(const invalid_argument&) _NOEXCEPT = default; + invalid_argument& operator=(const invalid_argument&) _NOEXCEPT = default; ~invalid_argument() _NOEXCEPT override; #endif }; @@ -154,6 +156,7 @@ _LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s) : logic_error(__s) {} #ifndef _LIBCPP_ABI_VCRUNTIME length_error(const length_error&) _NOEXCEPT = default; + length_error& operator=(const length_error&) _NOEXCEPT = default; ~length_error() _NOEXCEPT override; #endif }; @@ -167,6 +170,7 @@ #ifndef _LIBCPP_ABI_VCRUNTIME out_of_range(const out_of_range&) _NOEXCEPT = default; + out_of_range& operator=(const out_of_range&) _NOEXCEPT = default; ~out_of_range() _NOEXCEPT override; #endif }; @@ -180,6 +184,7 @@ #ifndef _LIBCPP_ABI_VCRUNTIME range_error(const range_error&) _NOEXCEPT = default; + range_error& operator=(const range_error&) _NOEXCEPT = default; ~range_error() _NOEXCEPT override; #endif }; @@ -193,6 +198,7 @@ #ifndef _LIBCPP_ABI_VCRUNTIME overflow_error(const overflow_error&) _NOEXCEPT = default; + overflow_error& operator=(const overflow_error&) _NOEXCEPT = default; ~overflow_error() _NOEXCEPT override; #endif }; @@ -206,6 +212,7 @@ #ifndef _LIBCPP_ABI_VCRUNTIME underflow_error(const underflow_error&) _NOEXCEPT = default; + underflow_error& operator=(const underflow_error&) _NOEXCEPT = default; ~underflow_error() _NOEXCEPT override; #endif }; Index: libcxx/include/typeinfo =================================================================== --- libcxx/include/typeinfo +++ libcxx/include/typeinfo @@ -360,7 +360,8 @@ { public: bad_cast() _NOEXCEPT; - bad_cast(const bad_cast&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI bad_cast(const bad_cast&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI bad_cast& operator=(const bad_cast&) _NOEXCEPT = default; ~bad_cast() _NOEXCEPT override; const char* what() const _NOEXCEPT override; }; @@ -370,6 +371,8 @@ { public: bad_typeid() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI bad_typeid(const bad_typeid&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI bad_typeid& operator=(const bad_typeid&) _NOEXCEPT = default; ~bad_typeid() _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 @@ -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/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/dereference.pass.cpp =================================================================== --- libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/dereference.pass.cpp +++ libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/dereference.pass.cpp @@ -27,6 +27,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/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp =================================================================== --- libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp +++ libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp @@ -24,6 +24,8 @@ int* shared_val; explicit Node(int* ptr) : shared_val(ptr) {} + Node(const Node&) = default; + Node& operator=(const Node&) = default; ~Node() { ++(*shared_val); } }; Index: libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp =================================================================== --- libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp +++ libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp @@ -22,10 +22,12 @@ struct Base { char* shared_buff; int* cur_idx; - const char id; + char id; explicit Base(char* buf, int* idx, char ch) : shared_buff(buf), cur_idx(idx), id(ch) {} + Base(const Base& other) = default; + Base& operator=(const Base&) = default; ~Base() { shared_buff[(*cur_idx)++] = id; } }; Index: libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp =================================================================== --- libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp +++ libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp @@ -21,6 +21,8 @@ struct Node { explicit Node() {} + Node(const Node&) = default; + Node& operator=(const Node&) = default; ~Node() {} }; Index: libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp =================================================================== --- libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp +++ libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp @@ -21,6 +21,8 @@ struct Node { explicit Node() {} + Node(const Node&) = default; + Node& operator=(const Node&) = default; ~Node() {} }; 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/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp =================================================================== --- libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp +++ libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp @@ -27,6 +27,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/language.support/support.coroutines/end.to.end/go.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/end.to.end/go.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/end.to.end/go.pass.cpp @@ -30,6 +30,9 @@ rh = nullptr; } + goroutine() = default; + goroutine(const goroutine&) = default; + goroutine& operator=(const goroutine&) = default; ~goroutine() {} static void run_one() Index: libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp +++ libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp @@ -28,6 +28,8 @@ int data_; public: explicit A(int data) : data_(data) {} + A(const A&) = default; + A& operator=(const A&) = default; virtual ~A() TEST_NOEXCEPT {} friend bool operator==(const A& x, const A& y) {return x.data_ == y.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,8 @@ 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,8 @@ 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,8 @@ 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; @@ -187,7 +189,8 @@ TEST_CONSTEXPR_CXX23 explicit CDeleter(int s) : state_(s) {} 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 @@ -164,7 +166,8 @@ #if TEST_STD_VER >= 11 nasty_list(std::initializer_list il) : l_(il) {} #endif - + nasty_list(const nasty_list&) = default; + nasty_list& operator=(const nasty_list&) = default; ~nasty_list() {} #if TEST_STD_VER >= 11 Index: libcxx/utils/libcxx/test/params.py =================================================================== --- libcxx/utils/libcxx/test/params.py +++ libcxx/utils/libcxx/test/params.py @@ -51,6 +51,8 @@ '-Wunused-parameter', '-Wunreachable-code', '-Wno-unused-local-typedef', + '-Wdeprecated-copy', + '-Wdeprecated-copy-dtor', ] _allStandards = ['c++03', 'c++11', 'c++14', 'c++17', 'c++20', 'c++2b'] Index: libcxxabi/test/exception_object_alignment.2.pass.cpp =================================================================== --- libcxxabi/test/exception_object_alignment.2.pass.cpp +++ libcxxabi/test/exception_object_alignment.2.pass.cpp @@ -18,6 +18,8 @@ struct exception { exception() : x(0) { } + exception(const exception&) = default; + exception& operator=(const exception&) = default; virtual ~exception() { } int x; };