From 66ee89d8b4c8be8414e4bc9d7f0dd4a8a1fd30b1 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Sun, 8 Oct 2023 15:42:15 +0800 Subject: [PATCH] [backport] Workaround Apple clang issue. (#9615) (#9636) --- src/common/io.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/io.h b/src/common/io.h index 95971abae..f582bf901 100644 --- a/src/common/io.h +++ b/src/common/io.h @@ -384,7 +384,8 @@ class PrivateMmapConstStream : public AlignedResourceReadStream { * @param length See the `length` parameter of `mmap` for details. */ explicit PrivateMmapConstStream(std::string path, std::size_t offset, std::size_t length) - : AlignedResourceReadStream{std::make_shared(path, offset, length)} {} + : AlignedResourceReadStream{std::shared_ptr{ // NOLINT + new MmapResource{std::move(path), offset, length}}} {} ~PrivateMmapConstStream() noexcept(false) override; };