Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

Fixed RTTI for exceptions (#27937)

Ilya Lavrenova1f4571f42d1
diff --git a/src/core/include/openvino/core/except.hpp b/src/core/include/openvino/core/except.hpp
index fdb3746d323..a923cd98c7e 100644
--- a/src/core/include/openvino/core/except.hpp
+++ b/src/core/include/openvino/core/except.hpp
@@ -62,6 +62,7 @@ public:
const char* check_string,
const std::string& context_info,
const std::string& explanation);
+ virtual ~AssertFailure();
protected:
explicit AssertFailure(const std::string& what_arg) : ov::Exception(what_arg) {}
@@ -71,6 +72,7 @@ protected:
class OPENVINO_API NotImplemented : public AssertFailure {
public:
[[noreturn]] static void create(const char* file, int line, const std::string& explanation);
+ virtual ~NotImplemented();
static const std::string default_msg;
diff --git a/src/core/src/except.cpp b/src/core/src/except.cpp
index 6ce0568e04e..7cddc5b3ec4 100644
--- a/src/core/src/except.cpp
+++ b/src/core/src/except.cpp
@@ -45,8 +45,12 @@ void ov::AssertFailure::create(const char* file,
throw ov::AssertFailure(make_what(file, line, check_string, context_info, explanation));
}
+ov::AssertFailure::~AssertFailure() = default;
+
void ov::NotImplemented::create(const char* file, int line, const std::string& explanation) {
throw ov::NotImplemented(make_what(file, line, nullptr, default_msg, explanation));
}
+ov::NotImplemented::~NotImplemented() = default;
+
const std::string ov::NotImplemented::default_msg{"Not Implemented"};