[libcxx-commits] [libcxx] 7853371 - [libc++] [test] Qualify `move` as `std::move` in a lot of tests. NFCI.

Arthur O'Dwyer via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 16 08:03:57 PST 2022


Author: Arthur O'Dwyer
Date: 2022-02-16T11:03:31-05:00
New Revision: 7853371146d1f40513d5dfe5bc6b3f958cda97af

URL: https://github.com/llvm/llvm-project/commit/7853371146d1f40513d5dfe5bc6b3f958cda97af
DIFF: https://github.com/llvm/llvm-project/commit/7853371146d1f40513d5dfe5bc6b3f958cda97af.diff

LOG: [libc++] [test] Qualify `move` as `std::move` in a lot of tests. NFCI.

We shouldn't be calling `move` via ADL -- and neither should anybody
in the wild be calling it via ADL, so it's not like we need to test
this ADL ability of `move` in particular.

Reviewed as part of D119860.

Added: 
    

Modified: 
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp
index 863fd3ef87a7e..8e76e117d56bd 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp
@@ -30,7 +30,7 @@ int main(int, char**)
         f.pubseekoff(1, std::ios_base::beg);
         assert(f.sgetc() == '2');
         std::filebuf f2;
-        f2 = move(f);
+        f2 = std::move(f);
         assert(!f.is_open());
         assert(f2.is_open());
         assert(f2.sgetc() == '2');
@@ -47,7 +47,7 @@ int main(int, char**)
         f.pubseekoff(1, std::ios_base::beg);
         assert(f.sgetc() == L'2');
         std::wfilebuf f2;
-        f2 = move(f);
+        f2 = std::move(f);
         assert(!f.is_open());
         assert(f2.is_open());
         assert(f2.sgetc() == L'2');

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
index 90a7cf6ed69c6..74995054a3f3d 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
@@ -25,7 +25,7 @@ int main(int, char**)
         std::fstream fso(temp.c_str(), std::ios_base::in | std::ios_base::out
                                                  | std::ios_base::trunc);
         std::fstream fs;
-        fs = move(fso);
+        fs = std::move(fso);
         double x = 0;
         fs << 3.25;
         fs.seekg(0);
@@ -39,7 +39,7 @@ int main(int, char**)
         std::wfstream fso(temp.c_str(), std::ios_base::in | std::ios_base::out
                                                   | std::ios_base::trunc);
         std::wfstream fs;
-        fs = move(fso);
+        fs = std::move(fso);
         double x = 0;
         fs << 3.25;
         fs.seekg(0);

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
index abb3863c12984..75f4295677ccb 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
@@ -25,7 +25,7 @@ int main(int, char**)
     {
         std::ifstream fso("test.dat");
         std::ifstream fs;
-        fs = move(fso);
+        fs = std::move(fso);
         double x = 0;
         fs >> x;
         assert(x == 3.25);
@@ -34,7 +34,7 @@ int main(int, char**)
     {
         std::wifstream fso("test.dat");
         std::wifstream fs;
-        fs = move(fso);
+        fs = std::move(fso);
         double x = 0;
         fs >> x;
         assert(x == 3.25);

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp
index 71e57a1f9bcb2..276fef55fbf36 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp
@@ -24,7 +24,7 @@ int main(int, char**)
     {
         std::ofstream fso(temp.c_str());
         std::ofstream fs;
-        fs = move(fso);
+        fs = std::move(fso);
         fs << 3.25;
     }
     {
@@ -39,7 +39,7 @@ int main(int, char**)
     {
         std::wofstream fso(temp.c_str());
         std::wofstream fs;
-        fs = move(fso);
+        fs = std::move(fso);
         fs << 3.25;
     }
     {

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp
index 27b9579f5b9da..3ae562e17e803 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp
@@ -23,38 +23,38 @@ int main(int, char**)
     {
         std::stringbuf buf1("testing");
         std::stringbuf buf;
-        buf = move(buf1);
+        buf = std::move(buf1);
         assert(buf.str() == "testing");
     }
     {
         std::stringbuf buf1("testing", std::ios_base::in);
         std::stringbuf buf;
-        buf = move(buf1);
+        buf = std::move(buf1);
         assert(buf.str() == "testing");
     }
     {
         std::stringbuf buf1("testing", std::ios_base::out);
         std::stringbuf buf;
-        buf = move(buf1);
+        buf = std::move(buf1);
         assert(buf.str() == "testing");
     }
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringbuf buf1(L"testing");
         std::wstringbuf buf;
-        buf = move(buf1);
+        buf = std::move(buf1);
         assert(buf.str() == L"testing");
     }
     {
         std::wstringbuf buf1(L"testing", std::ios_base::in);
         std::wstringbuf buf;
-        buf = move(buf1);
+        buf = std::move(buf1);
         assert(buf.str() == L"testing");
     }
     {
         std::wstringbuf buf1(L"testing", std::ios_base::out);
         std::wstringbuf buf;
-        buf = move(buf1);
+        buf = std::move(buf1);
         assert(buf.str() == L"testing");
     }
 #endif // TEST_HAS_NO_WIDE_CHARACTERS

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp
index f9f8cd95fb984..42c4c134ac472 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp
@@ -31,7 +31,7 @@ TEST_CONSTEXPR_CXX20 void test0(typename S::value_type lhs, const S& rhs, const
 #if TEST_STD_VER >= 11
 template <class S>
 TEST_CONSTEXPR_CXX20 void test1(typename S::value_type lhs, S&& rhs, const S& x) {
-  assert(lhs + move(rhs) == x);
+  assert(lhs + std::move(rhs) == x);
 }
 #endif
 

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp
index 89fadc2227e29..5f0c67f7e3ee0 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp
@@ -31,7 +31,7 @@ TEST_CONSTEXPR_CXX20 void test0(const typename S::value_type* lhs, const S& rhs,
 #if TEST_STD_VER >= 11
 template <class S>
 TEST_CONSTEXPR_CXX20 void test1(const typename S::value_type* lhs, S&& rhs, const S& x) {
-  assert(lhs + move(rhs) == x);
+  assert(lhs + std::move(rhs) == x);
 }
 #endif
 

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp
index ee2a239539687..4f516b8667d59 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp
@@ -31,7 +31,7 @@ TEST_CONSTEXPR_CXX20 void test0(const S& lhs, typename S::value_type rhs, const
 #if TEST_STD_VER >= 11
 template <class S>
 TEST_CONSTEXPR_CXX20 void test1(S&& lhs, typename S::value_type rhs, const S& x) {
-  assert(move(lhs) + rhs == x);
+  assert(std::move(lhs) + rhs == x);
 }
 #endif
 

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp
index bdcc464e5a8e9..66e57c8ce7c3d 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp
@@ -31,7 +31,7 @@ TEST_CONSTEXPR_CXX20 void test0(const S& lhs, const typename S::value_type* rhs,
 #if TEST_STD_VER >= 11
 template <class S>
 TEST_CONSTEXPR_CXX20 void test1(S&& lhs, const typename S::value_type* rhs, const S& x) {
-  assert(move(lhs) + rhs == x);
+  assert(std::move(lhs) + rhs == x);
 }
 #endif
 

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp
index 3c349ed96f74c..bf6791e019aa0 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp
@@ -43,17 +43,17 @@ TEST_CONSTEXPR_CXX20 void test0(const S& lhs, const S& rhs, const S& x) {
 #if TEST_STD_VER >= 11
 template <class S>
 TEST_CONSTEXPR_CXX20 void test1(S&& lhs, const S& rhs, const S& x) {
-  assert(move(lhs) + rhs == x);
+  assert(std::move(lhs) + rhs == x);
 }
 
 template <class S>
 TEST_CONSTEXPR_CXX20 void test2(const S& lhs, S&& rhs, const S& x) {
-  assert(lhs + move(rhs) == x);
+  assert(lhs + std::move(rhs) == x);
 }
 
 template <class S>
 TEST_CONSTEXPR_CXX20 void test3(S&& lhs, S&& rhs, const S& x) {
-  assert(move(lhs) + move(rhs) == x);
+  assert(std::move(lhs) + std::move(rhs) == x);
 }
 #endif
 


        


More information about the libcxx-commits mailing list