Skip to content

Commit

Permalink
[libc++] [test] Qualify move as std::move in a lot of tests. NFCI.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Arthur O'Dwyer committed Feb 16, 2022
1 parent 3f3abaf commit 7853371
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
Expand Up @@ -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');
Expand All @@ -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');
Expand Down
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Expand Up @@ -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;
}
{
Expand All @@ -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;
}
{
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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

Expand Down
Expand Up @@ -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

Expand Down
Expand Up @@ -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

Expand Down
Expand Up @@ -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

Expand Down
Expand Up @@ -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

Expand Down

0 comments on commit 7853371

Please sign in to comment.