[llvm] [orc-rt] Fix unused function warning in testcase. (PR #206894)
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 30 22:56:25 PDT 2026
https://github.com/lhames created https://github.com/llvm/llvm-project/pull/206894
Fixes -Wunused-function warning on peekAtErrorMessage by only defining that function when ORC_RT_ENABLE_EXCEPTIONS has been turned on.
>From 66899e8d1f700fc13d9dd54f1a75bfc769588c3b Mon Sep 17 00:00:00 2001
From: Lang Hames <lhames at gmail.com>
Date: Wed, 1 Jul 2026 15:43:49 +1000
Subject: [PATCH] [orc-rt] Fix unused function warning in testcase.
Fixes -Wunused-function warning on peekAtErrorMessage by only defining that
function when ORC_RT_ENABLE_EXCEPTIONS has been turned on.
---
orc-rt/unittests/ErrorExceptionInteropTest.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/orc-rt/unittests/ErrorExceptionInteropTest.cpp b/orc-rt/unittests/ErrorExceptionInteropTest.cpp
index dd106f14ee6e5..cdb50fe2e2b06 100644
--- a/orc-rt/unittests/ErrorExceptionInteropTest.cpp
+++ b/orc-rt/unittests/ErrorExceptionInteropTest.cpp
@@ -123,6 +123,7 @@ TEST(ErrorExceptionInteropTest, RoundTripExceptionThroughError) {
});
}
+#if ORC_RT_ENABLE_EXCEPTIONS
static std::string peekAtErrorMessage(Error &Err) {
std::string Msg;
Err = handleErrors(std::move(Err), [&](std::unique_ptr<ErrorInfoBase> EIB) {
@@ -131,6 +132,7 @@ static std::string peekAtErrorMessage(Error &Err) {
});
return Msg;
}
+#endif // ORC_RT_ENABLE_EXCEPTIONS
TEST(ErrorExceptionInteropTest, RoundTripErrorThroughException) {
// Test Error → Exception → Error preserves type and message
More information about the llvm-commits
mailing list