-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C++] util/small_vector_test.cc reports a self-move warning with MinGW #35651
Comments
### Rationale for this change Because MinGW g++ reports a warning: ```text D:/a/arrow/arrow/cpp/src/arrow/util/small_vector_test.cc:417:22: warning: moving 'moved_moved_ints' of type 'arrow::internal::TestSmallStaticVector< arrow::internal::VectorIntLikeParam< arrow::internal::StaticVectorTraits, arrow::MoveOnlyDataType> >::IntVectorType<5>' {aka 'arrow::internal::StaticVectorImpl< arrow::MoveOnlyDataType, 5, arrow::internal::StaticVectorStorage<arrow::MoveOnlyDataType, 5, true> >'} to itself [-Wself-move] 417 | moved_moved_ints = std::move(moved_moved_ints); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:/a/arrow/arrow/cpp/src/arrow/util/small_vector_test.cc:417:22: note: remove 'std::move' call ``` ### What changes are included in this PR? Disable self-move code only for MinGW. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: #35651 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
I got the same error on macos with gcc 13.1 /Users/zhjwpku/zhjwpku/arrow/cpp/src/arrow/util/small_vector_test.cc:418:22: error: moving 'moved_moved_ints' of type 'arrow::internal::TestSmallStaticVector<arrow::internal::VectorIntLikeParam<arrow::internal::SmallVectorTraits, arrow::MoveOnlyDataType> >::IntVectorType<5>' {aka 'arrow::internal::StaticVectorImpl<arrow::MoveOnlyDataType, 5, arrow::internal::SmallVectorStorage<arrow::MoveOnlyDataType, 5> >'} to itself [-Werror=self-move] I checked the GCC 13 Release note, this is a newly added warning, I guess the warning with MinGW might be using |
PR apache#35653 had a fix for MinGW, but I think the real cause is that gcc add a new warning -Wself-move. see https://gcc.gnu.org/gcc-13/changes.html. We should suppress it if we need to move to itself. Signed-off-by: Zhao Junwang <zhjwpku@gmail.com>
### Rationale for this change PR #35653 had a fix for MinGW, but I think the real cause is that gcc add a new warning -Wself-move. see https://gcc.gnu.org/gcc-13/changes.html. We should suppress it if we need to move to itself. ### What changes are included in this PR? suppress self-move warning by adding a cpp flag ### Are these changes tested? Yes ### Are there any user-facing changes? No * Closes: #35651 Authored-by: Zhao Junwang <zhjwpku@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
Describe the bug, including details regarding any error messages, version, and platform.
https://github.com/apache/arrow/actions/runs/5006155150/jobs/8971042580#step:7:1154
Component(s)
C++
The text was updated successfully, but these errors were encountered: