[libcxx-commits] [PATCH] D118502: [libc++][test] Clean up libcxx/test/support/MoveOnly.h

Joe Loser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jan 29 15:21:40 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG81cc834a4801: [libc++][test] Clean up libcxx/test/support/MoveOnly.h (authored by joe_loser).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118502/new/

https://reviews.llvm.org/D118502

Files:
  libcxx/test/std/containers/sequences/array/array.creation/to_array.fail.cpp
  libcxx/test/support/MoveOnly.h


Index: libcxx/test/support/MoveOnly.h
===================================================================
--- libcxx/test/support/MoveOnly.h
+++ libcxx/test/support/MoveOnly.h
@@ -18,9 +18,6 @@
 
 class MoveOnly
 {
-    MoveOnly(const MoveOnly&);
-    MoveOnly& operator=(const MoveOnly&);
-
     int data_;
 public:
     constexpr MoveOnly(int data = 1) : data_(data) {}
@@ -53,18 +50,15 @@
     friend void operator,(T t, U u) = delete;
 };
 
-namespace std {
 
 template <>
-struct hash<MoveOnly>
+struct std::hash<MoveOnly>
 {
     typedef MoveOnly argument_type;
     typedef size_t result_type;
     constexpr size_t operator()(const MoveOnly& x) const {return x.get();}
 };
 
-}
-
 #endif // TEST_STD_VER >= 11
 
 #endif // MOVEONLY_H
Index: libcxx/test/std/containers/sequences/array/array.creation/to_array.fail.cpp
===================================================================
--- libcxx/test/std/containers/sequences/array/array.creation/to_array.fail.cpp
+++ libcxx/test/std/containers/sequences/array/array.creation/to_array.fail.cpp
@@ -28,14 +28,14 @@
   {
     MoveOnly mo[] = {MoveOnly{3}};
     // expected-error at array:* {{to_array requires copy constructible elements}}
-    // expected-error at array:* {{calling a private constructor}}
+    // expected-error at array:* {{call to implicitly-deleted copy constructor of 'MoveOnly'}}
     std::to_array(mo); // expected-note {{requested here}}
   }
 
   {
     const MoveOnly cmo[] = {MoveOnly{3}};
     // expected-error at array:* {{to_array requires move constructible elements}}
-    // expected-error at array:* {{calling a private constructor}}
+    // expected-error at array:* {{call to implicitly-deleted copy constructor of 'MoveOnly'}}
     std::to_array(std::move(cmo)); // expected-note {{requested here}}
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118502.404306.patch
Type: text/x-patch
Size: 1786 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220129/bdc5cf7e/attachment.bin>


More information about the libcxx-commits mailing list