[llvm] [CAS] Fix build failure from #114099 using gcc (PR #158697)

Steven Wu via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 15 10:39:41 PDT 2025


https://github.com/cachemeifyoucan created https://github.com/llvm/llvm-project/pull/158697

Fix a buildbot failure on some bots using gcc:
```
MappedFileRegionArena.cpp:275:10: error: could not convert ‘Result’ from ‘llvm::cas::MappedFileRegionArena’ to ‘llvm::Expected<llvm::cas::MappedFileRegionArena>’
```
This is caused by RVO not activated causing the type check error.


>From 4c69f77aeba8b8cdc282d9a7bec6acd995503930 Mon Sep 17 00:00:00 2001
From: Steven Wu <stevenwu at apple.com>
Date: Mon, 15 Sep 2025 10:39:31 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.6
---
 llvm/lib/CAS/MappedFileRegionArena.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/CAS/MappedFileRegionArena.cpp b/llvm/lib/CAS/MappedFileRegionArena.cpp
index 3c920edcaae6a..2deb87d7adecf 100644
--- a/llvm/lib/CAS/MappedFileRegionArena.cpp
+++ b/llvm/lib/CAS/MappedFileRegionArena.cpp
@@ -272,7 +272,7 @@ Expected<MappedFileRegionArena> MappedFileRegionArena::create(
 
   // Release the shared lock so it can be closed in destoryImpl().
   SharedFileLock->release();
-  return Result;
+  return std::move(Result);
 }
 
 void MappedFileRegionArena::destroyImpl() {



More information about the llvm-commits mailing list