Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Fix warning about unqualified move
Browse files Browse the repository at this point in the history
This came up with newer clang releases

fixes nvbug3918987
  • Loading branch information
miscco committed Jan 9, 2023
1 parent 25658c1 commit 9d71e9a
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 48 deletions.
26 changes: 13 additions & 13 deletions include/cuda/std/detail/libcxx/include/valarray
Original file line number Diff line number Diff line change
Expand Up @@ -1488,21 +1488,21 @@ public:
gslice(size_t __start, const valarray<size_t>& __size,
valarray<size_t>&& __stride)
: __size_(__size),
__stride_(move(__stride))
__stride_(_CUDA_VSTD::move(__stride))
{__init(__start);}

_LIBCUDACXX_INLINE_VISIBILITY
gslice(size_t __start, valarray<size_t>&& __size,
const valarray<size_t>& __stride)
: __size_(move(__size)),
: __size_(_CUDA_VSTD::move(__size)),
__stride_(__stride)
{__init(__start);}

_LIBCUDACXX_INLINE_VISIBILITY
gslice(size_t __start, valarray<size_t>&& __size,
valarray<size_t>&& __stride)
: __size_(move(__size)),
__stride_(move(__stride))
: __size_(_CUDA_VSTD::move(__size)),
__stride_(_CUDA_VSTD::move(__stride))
{__init(__start);}

#endif // _LIBCUDACXX_CXX03_LANG
Expand Down Expand Up @@ -1653,7 +1653,7 @@ private:
#ifndef _LIBCUDACXX_CXX03_LANG
gslice_array(gslice&& __gs, const valarray<value_type>& __v)
: __vp_(const_cast<value_type*>(__v.__begin_)),
__1d_(move(__gs.__1d_))
__1d_(_CUDA_VSTD::move(__gs.__1d_))
{}
#endif // _LIBCUDACXX_CXX03_LANG

Expand Down Expand Up @@ -2347,7 +2347,7 @@ private:
_LIBCUDACXX_INLINE_VISIBILITY
indirect_array(valarray<size_t>&& __ia, const valarray<value_type>& __v)
: __vp_(const_cast<value_type*>(__v.__begin_)),
__1d_(move(__ia))
__1d_(_CUDA_VSTD::move(__ia))
{}

#endif // _LIBCUDACXX_CXX03_LANG
Expand Down Expand Up @@ -2566,7 +2566,7 @@ private:
_LIBCUDACXX_INLINE_VISIBILITY
__indirect_expr(valarray<size_t>&& __ia, const _RmExpr& __e)
: __expr_(__e),
__1d_(move(__ia))
__1d_(_CUDA_VSTD::move(__ia))
{}

#endif // _LIBCUDACXX_CXX03_LANG
Expand Down Expand Up @@ -3172,15 +3172,15 @@ inline
__val_expr<__indirect_expr<const valarray<_Tp>&> >
valarray<_Tp>::operator[](gslice&& __gs) const
{
return __val_expr<__indirect_expr<const valarray&> >(__indirect_expr<const valarray&>(move(__gs.__1d_), *this));
return __val_expr<__indirect_expr<const valarray&> >(__indirect_expr<const valarray&>(_CUDA_VSTD::move(__gs.__1d_), *this));
}

template <class _Tp>
inline
gslice_array<_Tp>
valarray<_Tp>::operator[](gslice&& __gs)
{
return gslice_array<value_type>(move(__gs), *this);
return gslice_array<value_type>(_CUDA_VSTD::move(__gs), *this);
}

#endif // _LIBCUDACXX_CXX03_LANG
Expand Down Expand Up @@ -3208,15 +3208,15 @@ inline
__val_expr<__mask_expr<const valarray<_Tp>&> >
valarray<_Tp>::operator[](valarray<bool>&& __vb) const
{
return __val_expr<__mask_expr<const valarray&> >(__mask_expr<const valarray&>(move(__vb), *this));
return __val_expr<__mask_expr<const valarray&> >(__mask_expr<const valarray&>(_CUDA_VSTD::move(__vb), *this));
}

template <class _Tp>
inline
mask_array<_Tp>
valarray<_Tp>::operator[](valarray<bool>&& __vb)
{
return mask_array<value_type>(move(__vb), *this);
return mask_array<value_type>(_CUDA_VSTD::move(__vb), *this);
}

#endif // _LIBCUDACXX_CXX03_LANG
Expand Down Expand Up @@ -3244,15 +3244,15 @@ inline
__val_expr<__indirect_expr<const valarray<_Tp>&> >
valarray<_Tp>::operator[](valarray<size_t>&& __vs) const
{
return __val_expr<__indirect_expr<const valarray&> >(__indirect_expr<const valarray&>(move(__vs), *this));
return __val_expr<__indirect_expr<const valarray&> >(__indirect_expr<const valarray&>(_CUDA_VSTD::move(__vs), *this));
}

template <class _Tp>
inline
indirect_array<_Tp>
valarray<_Tp>::operator[](valarray<size_t>&& __vs)
{
return indirect_array<value_type>(move(__vs), *this);
return indirect_array<value_type>(_CUDA_VSTD::move(__vs), *this);
}

#endif // _LIBCUDACXX_CXX03_LANG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int main(int, char**)
assert(f.sputn("123", 3) == 3);
f.pubseekoff(1, std::ios_base::beg);
assert(f.sgetc() == '2');
std::filebuf f2(move(f));
std::filebuf f2(std::move(f));
assert(!f.is_open());
assert(f2.is_open());
assert(f2.sgetc() == '2');
Expand All @@ -45,7 +45,7 @@ int main(int, char**)
assert(f.sputn(L"123", 3) == 3);
f.pubseekoff(1, std::ios_base::beg);
assert(f.sgetc() == L'2');
std::wfilebuf f2(move(f));
std::wfilebuf f2(std::move(f));
assert(!f.is_open());
assert(f2.is_open());
assert(f2.sgetc() == L'2');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int main(int, char**)
{
std::fstream fso(temp, std::ios_base::in | std::ios_base::out
| std::ios_base::trunc);
std::fstream fs = move(fso);
std::fstream fs = std::move(fso);
double x = 0;
fs << 3.25;
fs.seekg(0);
Expand All @@ -37,7 +37,7 @@ int main(int, char**)
{
std::wfstream fso(temp, std::ios_base::in | std::ios_base::out
| std::ios_base::trunc);
std::wfstream fs = move(fso);
std::wfstream fs = std::move(fso);
double x = 0;
fs << 3.25;
fs.seekg(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ 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);
}
{
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ int main(int, char**)
{
{
std::ifstream fso("test.dat");
std::ifstream fs = move(fso);
std::ifstream fs = std::move(fso);
double x = 0;
fs >> x;
assert(x == 3.25);
}
{
std::wifstream fso("test.dat");
std::wifstream fs = move(fso);
std::wifstream fs = std::move(fso);
double x = 0;
fs >> x;
assert(x == 3.25);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int main(int, char**)
std::string temp = get_temp_file_name();
{
std::ofstream fso(temp.c_str());
std::ofstream fs = move(fso);
std::ofstream fs = std::move(fso);
fs << 3.25;
}
{
Expand All @@ -37,7 +37,7 @@ int main(int, char**)
std::remove(temp.c_str());
{
std::wofstream fso(temp.c_str());
std::wofstream fs = move(fso);
std::wofstream fs = std::move(fso);
fs << 3.25;
}
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,37 @@ 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");
}
{
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");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,32 @@ int main(int, char**)
{
{
std::stringbuf buf1("testing");
std::stringbuf buf(move(buf1));
std::stringbuf buf(std::move(buf1));
assert(buf.str() == "testing");
}
{
std::stringbuf buf1("testing", std::ios_base::in);
std::stringbuf buf(move(buf1));
std::stringbuf buf(std::move(buf1));
assert(buf.str() == "testing");
}
{
std::stringbuf buf1("testing", std::ios_base::out);
std::stringbuf buf(move(buf1));
std::stringbuf buf(std::move(buf1));
assert(buf.str() == "testing");
}
{
std::wstringbuf buf1(L"testing");
std::wstringbuf buf(move(buf1));
std::wstringbuf buf(std::move(buf1));
assert(buf.str() == L"testing");
}
{
std::wstringbuf buf1(L"testing", std::ios_base::in);
std::wstringbuf buf(move(buf1));
std::wstringbuf buf(std::move(buf1));
assert(buf.str() == L"testing");
}
{
std::wstringbuf buf1(L"testing", std::ios_base::out);
std::wstringbuf buf(move(buf1));
std::wstringbuf buf(std::move(buf1));
assert(buf.str() == L"testing");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void test0(typename S::value_type lhs, const S& rhs, const S& x) {
#if TEST_STD_VER >= 11
template <class S>
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void test0(const typename S::value_type* lhs, const S& rhs, const S& x) {
#if TEST_STD_VER >= 11
template <class S>
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void test0(const S& lhs, typename S::value_type rhs, const S& x) {
#if TEST_STD_VER >= 11
template <class S>
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void test0(const S& lhs, const typename S::value_type* rhs, const S& x) {
#if TEST_STD_VER >= 11
template <class S>
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ void test0(const S& lhs, const S& rhs, const S& x) {
#if TEST_STD_VER >= 11
template <class S>
void test1(S&& lhs, const S& rhs, const S& x) {
assert(move(lhs) + rhs == x);
assert(std::move(lhs) + rhs == x);
}

template <class S>
void test2(const S& lhs, S&& rhs, const S& x) {
assert(lhs + move(rhs) == x);
assert(lhs + std::move(rhs) == x);
}

template <class S>
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 9d71e9a

Please sign in to comment.