[libcxx-commits] [libcxxabi] 7024892 - [libc++][test] Add '-Wdeprecated-copy', '-Wdeprecated-copy-dtor' warnings to the test suite

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 12 05:53:49 PDT 2023


Author: Igor Zhukov
Date: 2023-09-12T08:53:38-04:00
New Revision: 70248920fcd804a5825ecf69f24b96a7e340afe6

URL: https://github.com/llvm/llvm-project/commit/70248920fcd804a5825ecf69f24b96a7e340afe6
DIFF: https://github.com/llvm/llvm-project/commit/70248920fcd804a5825ecf69f24b96a7e340afe6.diff

LOG: [libc++][test] Add '-Wdeprecated-copy', '-Wdeprecated-copy-dtor' warnings to the test suite

This is a follow up to https://reviews.llvm.org/D144694.
Fixes https://github.com/llvm/llvm-project/issues/60977.

Differential Revision: https://reviews.llvm.org/D144775

Added: 
    

Modified: 
    libcxx/include/__exception/exception.h
    libcxx/include/__exception/nested_exception.h
    libcxx/include/__expected/expected.h
    libcxx/include/__format/format_error.h
    libcxx/include/__functional/function.h
    libcxx/include/__memory/shared_ptr.h
    libcxx/include/new
    libcxx/include/optional
    libcxx/include/stdexcept
    libcxx/include/typeinfo
    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/dereference.pass.cpp
    libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp
    libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
    libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp
    libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.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/nullptr_t_assign_reentrant.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/front.insert.iter.ops/front.insert.iter.op=/lv_value.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/reverse.iterators/reverse.iter.elem/arrow.pass.cpp
    libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp
    libcxx/test/std/language.support/support.coroutines/end.to.end/go.pass.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/types.h
    libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/alloc_first.h
    libcxx/test/std/utilities/tuple/tuple.tuple/alloc_last.h
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp
    libcxx/test/support/counting_predicates.h
    libcxx/test/support/deleter_types.h
    libcxx/test/support/nasty_containers.h
    libcxx/utils/libcxx/test/params.py
    libcxxabi/test/exception_object_alignment.2.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__exception/exception.h b/libcxx/include/__exception/exception.h
index 3db0126da296916..e724e1b99bd14e7 100644
--- a/libcxx/include/__exception/exception.h
+++ b/libcxx/include/__exception/exception.h
@@ -72,7 +72,8 @@ class bad_exception : public exception {
 class _LIBCPP_EXPORTED_FROM_ABI exception {
 public:
   _LIBCPP_HIDE_FROM_ABI exception() _NOEXCEPT {}
-  _LIBCPP_HIDE_FROM_ABI exception(const exception&) _NOEXCEPT = default;
+  _LIBCPP_HIDE_FROM_ABI exception(const exception&) _NOEXCEPT            = default;
+  _LIBCPP_HIDE_FROM_ABI exception& operator=(const exception&) _NOEXCEPT = default;
 
   virtual ~exception() _NOEXCEPT;
   virtual const char* what() const _NOEXCEPT;
@@ -81,6 +82,8 @@ class _LIBCPP_EXPORTED_FROM_ABI exception {
 class _LIBCPP_EXPORTED_FROM_ABI bad_exception : public exception {
 public:
   _LIBCPP_HIDE_FROM_ABI 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;
 };

diff  --git a/libcxx/include/__exception/nested_exception.h b/libcxx/include/__exception/nested_exception.h
index 1136c9274888c93..769da191aa2d45d 100644
--- a/libcxx/include/__exception/nested_exception.h
+++ b/libcxx/include/__exception/nested_exception.h
@@ -33,8 +33,8 @@ class _LIBCPP_EXPORTED_FROM_ABI nested_exception {
 
 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

diff  --git a/libcxx/include/__expected/expected.h b/libcxx/include/__expected/expected.h
index eaf5bc8d6b38ff6..045370a486fae6b 100644
--- a/libcxx/include/__expected/expected.h
+++ b/libcxx/include/__expected/expected.h
@@ -928,6 +928,8 @@ class expected {
     requires(is_trivially_move_constructible_v<_ValueType> && is_trivially_move_constructible_v<_ErrorType>)
   union __union_t<_ValueType, _ErrorType> {
     _LIBCPP_HIDE_FROM_ABI constexpr __union_t() : __empty_() {}
+    _LIBCPP_HIDE_FROM_ABI constexpr __union_t(const __union_t&) = default;
+    _LIBCPP_HIDE_FROM_ABI constexpr __union_t& operator=(const __union_t&) = default;
 
     template <class _Func, class... _Args>
     _LIBCPP_HIDE_FROM_ABI constexpr explicit __union_t(
@@ -1529,6 +1531,8 @@ class expected<_Tp, _Err> {
     requires is_trivially_move_constructible_v<_ErrorType>
   union __union_t<_ErrorType> {
     _LIBCPP_HIDE_FROM_ABI constexpr __union_t() : __empty_() {}
+    _LIBCPP_HIDE_FROM_ABI constexpr __union_t(const __union_t&) = default;
+    _LIBCPP_HIDE_FROM_ABI constexpr __union_t& operator=(const __union_t&) = default;
 
     template <class _Func, class... _Args>
     _LIBCPP_HIDE_FROM_ABI constexpr explicit __union_t(

diff  --git a/libcxx/include/__format/format_error.h b/libcxx/include/__format/format_error.h
index f22cb0b81ec2e3a..51d6c58230910e7 100644
--- a/libcxx/include/__format/format_error.h
+++ b/libcxx/include/__format/format_error.h
@@ -30,6 +30,8 @@ class _LIBCPP_EXPORTED_FROM_ABI format_error : public runtime_error {
       : 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;
   _LIBCPP_HIDE_FROM_ABI_VIRTUAL
   ~format_error() noexcept override = default;
 };

diff  --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index a5da3debcfbc4e5..580dcf9aeeab6c2 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -57,6 +57,9 @@ class _LIBCPP_EXPORTED_FROM_ABI bad_function_call
     : 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.

diff  --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index abdf9aa274d4e42..845882ad31134d2 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -126,6 +126,7 @@ class _LIBCPP_EXPORTED_FROM_ABI bad_weak_ptr
 public:
     _LIBCPP_HIDE_FROM_ABI bad_weak_ptr() _NOEXCEPT = default;
     _LIBCPP_HIDE_FROM_ABI bad_weak_ptr(const bad_weak_ptr&) _NOEXCEPT = default;
+    _LIBCPP_HIDE_FROM_ABI bad_weak_ptr& operator=(const bad_weak_ptr&) _NOEXCEPT = default;
     ~bad_weak_ptr() _NOEXCEPT override;
     const char* what() const  _NOEXCEPT override;
 };

diff  --git a/libcxx/include/new b/libcxx/include/new
index ff563dc88db0f02..0a97c3e37add574 100644
--- a/libcxx/include/new
+++ b/libcxx/include/new
@@ -133,6 +133,8 @@ class _LIBCPP_EXPORTED_FROM_ABI bad_alloc
 {
 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;
 };
@@ -142,6 +144,8 @@ class _LIBCPP_EXPORTED_FROM_ABI bad_array_new_length
 {
 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;
 };

diff  --git a/libcxx/include/optional b/libcxx/include/optional
index 80146234fc9bffc..fc172c752582f00 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -249,6 +249,9 @@ class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_opt
     : 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;

diff  --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept
index 5428535a1022129..cc6b0c5f38819ba 100644
--- a/libcxx/include/stdexcept
+++ b/libcxx/include/stdexcept
@@ -129,6 +129,7 @@ public:
 
 #ifndef _LIBCPP_ABI_VCRUNTIME
     _LIBCPP_HIDE_FROM_ABI domain_error(const domain_error&) _NOEXCEPT = default;
+    _LIBCPP_HIDE_FROM_ABI domain_error& operator=(const domain_error&) _NOEXCEPT = default;
     ~domain_error() _NOEXCEPT override;
 #endif
 };
@@ -142,6 +143,7 @@ public:
 
 #ifndef _LIBCPP_ABI_VCRUNTIME
     _LIBCPP_HIDE_FROM_ABI invalid_argument(const invalid_argument&) _NOEXCEPT = default;
+    _LIBCPP_HIDE_FROM_ABI invalid_argument& operator=(const invalid_argument&) _NOEXCEPT = default;
     ~invalid_argument() _NOEXCEPT override;
 #endif
 };
@@ -154,6 +156,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s)   : logic_error(__s) {}
 #ifndef _LIBCPP_ABI_VCRUNTIME
     _LIBCPP_HIDE_FROM_ABI length_error(const length_error&) _NOEXCEPT = default;
+    _LIBCPP_HIDE_FROM_ABI length_error& operator=(const length_error&) _NOEXCEPT = default;
     ~length_error() _NOEXCEPT override;
 #endif
 };
@@ -167,6 +170,7 @@ public:
 
 #ifndef _LIBCPP_ABI_VCRUNTIME
     _LIBCPP_HIDE_FROM_ABI out_of_range(const out_of_range&) _NOEXCEPT = default;
+    _LIBCPP_HIDE_FROM_ABI out_of_range& operator=(const out_of_range&) _NOEXCEPT = default;
     ~out_of_range() _NOEXCEPT override;
 #endif
 };
@@ -180,6 +184,7 @@ public:
 
 #ifndef _LIBCPP_ABI_VCRUNTIME
     _LIBCPP_HIDE_FROM_ABI range_error(const range_error&) _NOEXCEPT = default;
+    _LIBCPP_HIDE_FROM_ABI range_error& operator=(const range_error&) _NOEXCEPT = default;
     ~range_error() _NOEXCEPT override;
 #endif
 };
@@ -193,6 +198,7 @@ public:
 
 #ifndef _LIBCPP_ABI_VCRUNTIME
     _LIBCPP_HIDE_FROM_ABI overflow_error(const overflow_error&) _NOEXCEPT = default;
+    _LIBCPP_HIDE_FROM_ABI overflow_error& operator=(const overflow_error&) _NOEXCEPT = default;
     ~overflow_error() _NOEXCEPT override;
 #endif
 };
@@ -206,6 +212,7 @@ public:
 
 #ifndef _LIBCPP_ABI_VCRUNTIME
     _LIBCPP_HIDE_FROM_ABI underflow_error(const underflow_error&) _NOEXCEPT = default;
+    _LIBCPP_HIDE_FROM_ABI underflow_error& operator=(const underflow_error&) _NOEXCEPT = default;
     ~underflow_error() _NOEXCEPT override;
 #endif
 };

diff  --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo
index 0dc9f09b9e25f91..59bc291454c3d90 100644
--- a/libcxx/include/typeinfo
+++ b/libcxx/include/typeinfo
@@ -360,6 +360,7 @@ class _LIBCPP_EXPORTED_FROM_ABI bad_cast
  public:
   bad_cast() _NOEXCEPT;
   _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;
 };
@@ -369,6 +370,8 @@ class _LIBCPP_EXPORTED_FROM_ABI bad_typeid
 {
  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;
 };

diff  --git a/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/arrow.pass.cpp b/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/arrow.pass.cpp
index 8b61df6d432a080..f0a181bcba88f1f 100644
--- a/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/arrow.pass.cpp
+++ b/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/arrow.pass.cpp
@@ -29,6 +29,8 @@ class A
     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 @@ class B
     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_;}

diff  --git a/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/dereference.pass.cpp b/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/dereference.pass.cpp
index 5698d8ddedb9d0a..bd6b6e0df038deb 100644
--- a/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/dereference.pass.cpp
+++ b/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.elem/dereference.pass.cpp
@@ -27,6 +27,8 @@ class A
     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)

diff  --git a/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp b/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp
index ba436d0461091a3..e11dc071485a790 100644
--- a/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp
+++ b/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp
@@ -24,6 +24,8 @@ struct Node {
   int* shared_val;
 
   explicit Node(int* ptr) : shared_val(ptr) {}
+  Node(const Node&) = default;
+  Node& operator=(const Node&) = default;
   ~Node() { ++(*shared_val); }
 };
 

diff  --git a/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp b/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
index 4e92a7bf98b624a..f8025f8ef57c5ec 100644
--- a/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
+++ b/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
@@ -26,6 +26,8 @@ struct Base {
 
   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&) = delete;
   ~Base() { shared_buff[(*cur_idx)++] = id; }
 };
 

diff  --git a/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp b/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp
index ef7325e60f67021..65e9069e07a1596 100644
--- a/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp
+++ b/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp
@@ -21,6 +21,8 @@ __attribute__((noinline)) void call_something() { asm volatile(""); }
 
 struct Node {
   explicit Node() {}
+  Node(const Node&) = default;
+  Node& operator=(const Node&) = default;
   ~Node() {}
 };
 

diff  --git a/libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp b/libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp
index 0d41c91d4429c9e..0b1a434ee45b52e 100644
--- a/libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp
+++ b/libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp
@@ -21,6 +21,8 @@ __attribute__((noinline)) void call_something() { asm volatile(""); }
 
 struct Node {
   explicit Node() {}
+  Node(const Node&) = default;
+  Node& operator=(const Node&) = default;
   ~Node() {}
 };
 

diff  --git a/libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp b/libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp
index b9cf2c6d5ecae3d..acf224e6b7d44c4 100644
--- a/libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp
+++ b/libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp
@@ -24,6 +24,9 @@ struct A
   static std::function<void()> global;
   static bool cancel;
 
+  A() = default;
+  A(const A&) = default;
+  A& operator=(const A&) = default;
   ~A() {
     DoNotOptimize(cancel);
     if (cancel)

diff  --git a/libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp b/libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp
index b8dc4e6d212edeb..83c342b1a5e6681 100644
--- a/libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp
+++ b/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 @@ struct A
   static std::function<void()> global;
   static bool cancel;
 
+  A() = default;
+  A(const A&) = default;
+  A& operator=(const A&) = default;
   ~A() {
     DoNotOptimize(cancel);
     if (cancel)

diff  --git a/libcxx/test/std/iterators/predef.iterators/insert.iterators/back.insert.iter.ops/back.insert.iter.op=/lv_value.pass.cpp b/libcxx/test/std/iterators/predef.iterators/insert.iterators/back.insert.iter.ops/back.insert.iter.op=/lv_value.pass.cpp
index d1e7c7897c8ec05..3c21a3750f355f4 100644
--- a/libcxx/test/std/iterators/predef.iterators/insert.iterators/back.insert.iter.ops/back.insert.iter.op=/lv_value.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/insert.iterators/back.insert.iter.ops/back.insert.iter.op=/lv_value.pass.cpp
@@ -37,6 +37,8 @@ class Copyable
     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)

diff  --git a/libcxx/test/std/iterators/predef.iterators/insert.iterators/front.insert.iter.ops/front.insert.iter.op=/lv_value.pass.cpp b/libcxx/test/std/iterators/predef.iterators/insert.iterators/front.insert.iter.ops/front.insert.iter.op=/lv_value.pass.cpp
index 922a95b931d44cc..b88b2a2a97c6694 100644
--- a/libcxx/test/std/iterators/predef.iterators/insert.iterators/front.insert.iter.ops/front.insert.iter.op=/lv_value.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/insert.iterators/front.insert.iter.ops/front.insert.iter.op=/lv_value.pass.cpp
@@ -37,6 +37,8 @@ class Copyable
     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)

diff  --git a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp
index 22f601e6ca30fb8..741cb88036a3a86 100644
--- a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp
@@ -26,6 +26,8 @@ class A
     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)

diff  --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp
index bbe9c3ca5802efc..15d18d9145ef0c8 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp
@@ -29,6 +29,8 @@ class A
     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 @@ class B
     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_;}

diff  --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp
index 19062d4d9aa352e..292c6da9a7733e0 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp
@@ -27,6 +27,8 @@ class A
     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)

diff  --git a/libcxx/test/std/language.support/support.coroutines/end.to.end/go.pass.cpp b/libcxx/test/std/language.support/support.coroutines/end.to.end/go.pass.cpp
index 2e49bdbb6244908..434858d87bb4f06 100644
--- a/libcxx/test/std/language.support/support.coroutines/end.to.end/go.pass.cpp
+++ b/libcxx/test/std/language.support/support.coroutines/end.to.end/go.pass.cpp
@@ -29,6 +29,9 @@ struct goroutine
     rh = nullptr;
   }
 
+  goroutine() = default;
+  goroutine(const goroutine&) = default;
+  goroutine& operator=(const goroutine&) = default;
   ~goroutine() {}
 
   static void run_one()

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/types.h b/libcxx/test/std/language.support/support.dynamic/new.delete/types.h
index b32d94dcd9dcc44..f19de73bf4417a2 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/types.h
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/types.h
@@ -22,6 +22,7 @@ struct TrackLifetime {
     TrackLifetime(LifetimeInformation& info) : info_(&info) {
         info_->address_constructed = this;
     }
+    TrackLifetime(TrackLifetime const&) = default;
     ~TrackLifetime() {
         info_->address_destroyed = this;
     }
@@ -43,6 +44,7 @@ struct alignas(std::max_align_t) TrackLifetimeMaxAligned {
     TrackLifetimeMaxAligned(LifetimeInformation& info) : info_(&info) {
         info_->address_constructed = this;
     }
+    TrackLifetimeMaxAligned(TrackLifetimeMaxAligned const&) = default;
     ~TrackLifetimeMaxAligned() {
         info_->address_destroyed = this;
     }

diff  --git a/libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp b/libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
index 6d239a5b89ada82..39bf62b8193bb45 100644
--- a/libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
+++ b/libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
@@ -28,6 +28,8 @@ class A
     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_;}

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp
index ebe63867eb7afa1..fb9c5a2ff4adbd0 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp
@@ -29,6 +29,9 @@ struct ZeroOnDestroy : std::ranges::view_base {
   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));
   }

diff  --git a/libcxx/test/std/utilities/tuple/tuple.tuple/alloc_first.h b/libcxx/test/std/utilities/tuple/tuple.tuple/alloc_first.h
index 571f795aa5763ea..4f91e5c39970908 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/alloc_first.h
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/alloc_first.h
@@ -44,6 +44,8 @@ struct alloc_first
         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)

diff  --git a/libcxx/test/std/utilities/tuple/tuple.tuple/alloc_last.h b/libcxx/test/std/utilities/tuple/tuple.tuple/alloc_last.h
index a893ec06246de8b..e6b6fd5d36f6bfa 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/alloc_last.h
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/alloc_last.h
@@ -44,6 +44,8 @@ struct alloc_last
         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)

diff  --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp
index d1c3cfb0479fb0e..9b04b196adb69ef 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp
+++ b/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() {}
 };
 

diff  --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp
index 93794c8b7a1f6f3..0f2b04e2475f59a 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp
@@ -36,7 +36,8 @@ struct B
     int id_;
 
     explicit B(int i) : id_(i) {}
-
+    B(const B&) = default;
+    B& operator=(const B&) = default;
     virtual ~B() {}
 };
 

diff  --git a/libcxx/test/support/counting_predicates.h b/libcxx/test/support/counting_predicates.h
index 7bf58b251b1f7db..db7ee481991c4a2 100644
--- a/libcxx/test/support/counting_predicates.h
+++ b/libcxx/test/support/counting_predicates.h
@@ -20,6 +20,8 @@ struct unary_counting_predicate {
     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); }

diff  --git a/libcxx/test/support/deleter_types.h b/libcxx/test/support/deleter_types.h
index 2afb9b3e6860bbf..7379c225cd3e15a 100644
--- a/libcxx/test/support/deleter_types.h
+++ b/libcxx/test/support/deleter_types.h
@@ -165,6 +165,8 @@ class CDeleter {
 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,7 +190,8 @@ class CDeleter<T[]> {
   TEST_CONSTEXPR_CXX23 explicit CDeleter(int s) : state_(s) {}
   template <class U>
   TEST_CONSTEXPR_CXX23 CDeleter(const CDeleter<U>& 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;

diff  --git a/libcxx/test/support/nasty_containers.h b/libcxx/test/support/nasty_containers.h
index f616f73b2676323..91e3af2e805b449 100644
--- a/libcxx/test/support/nasty_containers.h
+++ b/libcxx/test/support/nasty_containers.h
@@ -43,6 +43,8 @@ class nasty_vector
 #if TEST_STD_VER >= 11
     nasty_vector(std::initializer_list<value_type> il) : v_(il) {}
 #endif
+    nasty_vector(const nasty_vector&) = default;
+    nasty_vector& operator=(const nasty_vector&) = default;
     ~nasty_vector() {}
 
     template <class InputIterator>
@@ -174,7 +176,8 @@ class nasty_list
 #if TEST_STD_VER >= 11
     nasty_list(std::initializer_list<value_type> il) : l_(il) {}
 #endif
-
+    nasty_list(const nasty_list&) = default;
+    nasty_list& operator=(const nasty_list&) = default;
     ~nasty_list() {}
 
 #if TEST_STD_VER >= 11

diff  --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index 4eb799ce01bc2c4..6a454b0fce765c2 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -25,6 +25,8 @@
     "-Wno-aligned-allocation-unavailable",
     "-Wno-atomic-alignment",
     "-Wno-reserved-module-identifier",
+    '-Wdeprecated-copy',
+    '-Wdeprecated-copy-dtor',
     # GCC warns about places where we might want to add sized allocation/deallocation
     # functions, but we know better what we're doing/testing in the test suite.
     "-Wno-sized-deallocation",

diff  --git a/libcxxabi/test/exception_object_alignment.2.pass.cpp b/libcxxabi/test/exception_object_alignment.2.pass.cpp
index 1afa36e9109b16a..12bdbb62e7cc6cb 100644
--- a/libcxxabi/test/exception_object_alignment.2.pass.cpp
+++ b/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;
 };


        


More information about the libcxx-commits mailing list