[llvm] [orc-rt] Add missing noexcept specifiers to RTTI.h. (PR #206979)
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 1 06:31:05 PDT 2026
https://github.com/lhames created https://github.com/llvm/llvm-project/pull/206979
Adds noexcept specifiers that were missing from some methods in RTTI.h.
>From 903ece267dfd9903fc1e563a64f76b4763f2413c Mon Sep 17 00:00:00 2001
From: Lang Hames <lhames at gmail.com>
Date: Wed, 1 Jul 2026 23:29:09 +1000
Subject: [PATCH] [orc-rt] Add missing noexcept specifiers to RTTI.h.
Adds noexcept specifiers that were missing from some methods in RTTI.h.
---
orc-rt/include/orc-rt/RTTI.h | 6 +++---
orc-rt/lib/executor/RTTI.cpp | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/orc-rt/include/orc-rt/RTTI.h b/orc-rt/include/orc-rt/RTTI.h
index 8ac96d1aaf4dd..58bf7bcd20c63 100644
--- a/orc-rt/include/orc-rt/RTTI.h
+++ b/orc-rt/include/orc-rt/RTTI.h
@@ -66,7 +66,7 @@ template <typename ThisT, typename ParentT> class RTTIExtends;
/// type comparisons.
class RTTIRoot {
public:
- virtual ~RTTIRoot() = default;
+ virtual ~RTTIRoot() noexcept = default;
/// Returns the class ID for this type.
static const void *classID() noexcept { return &ID; }
@@ -87,7 +87,7 @@ class RTTIRoot {
static bool classof(const RTTIRoot *R) noexcept { return R->isA<RTTIRoot>(); }
private:
- virtual void anchor();
+ virtual void anchor() noexcept;
static char ID;
};
@@ -129,7 +129,7 @@ template <typename ThisT, typename ParentT> class RTTIExtends : public ParentT {
return ClassID == classID() || ParentT::isA(ClassID);
}
- static bool classof(const RTTIRoot *R) { return R->isA<ThisT>(); }
+ static bool classof(const RTTIRoot *R) noexcept { return R->isA<ThisT>(); }
};
template <typename ThisT, typename ParentT>
diff --git a/orc-rt/lib/executor/RTTI.cpp b/orc-rt/lib/executor/RTTI.cpp
index f4e4bc83b6c91..0cf716c1090fe 100644
--- a/orc-rt/lib/executor/RTTI.cpp
+++ b/orc-rt/lib/executor/RTTI.cpp
@@ -15,6 +15,6 @@
namespace orc_rt {
char RTTIRoot::ID = 0;
-void RTTIRoot::anchor() {}
+void RTTIRoot::anchor() noexcept {}
} // namespace orc_rt
More information about the llvm-commits
mailing list