Skip to content

Commit 110efed

Browse files
authored
GH-41024: [C++] IO: fixing compiling in gcc 7.5.0 (#41025)
### Rationale for this change Previous pr ( #39807 ) remove std::move when returning value, however, it's not allowed in some old compilers ### What changes are included in this PR? add std::move for return, and add reason for that ### Are these changes tested? Should test by other ci ### Are there any user-facing changes? no * GitHub Issue: #41024 Authored-by: mwish <maplewish117@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 074d45f commit 110efed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cpp/src/arrow/io/compressed.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,9 @@ class CompressedInputStream::Impl {
405405
ARROW_ASSIGN_OR_RAISE(auto buf, AllocateResizableBuffer(nbytes, pool_));
406406
ARROW_ASSIGN_OR_RAISE(int64_t bytes_read, Read(nbytes, buf->mutable_data()));
407407
RETURN_NOT_OK(buf->Resize(bytes_read));
408-
return buf;
408+
// Using std::move because the some compiler might has issue below:
409+
// https://wg21.cmeerw.net/cwg/issue1579
410+
return std::move(buf);
409411
}
410412

411413
const std::shared_ptr<InputStream>& raw() const { return raw_; }

0 commit comments

Comments
 (0)