Skip to content

Commit

Permalink
Fixed RTTI for exceptions (#27937)
Browse files Browse the repository at this point in the history
### Details:
 - We need to export virtual functions to fix RTTI
  • Loading branch information
ilya-lavrenov authored Dec 5, 2024
1 parent be4d291 commit a1f4571
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/include/openvino/core/except.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class OPENVINO_API AssertFailure : public Exception {
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) {}
Expand All @@ -71,6 +72,7 @@ class OPENVINO_API AssertFailure : public Exception {
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;

Expand Down
4 changes: 4 additions & 0 deletions src/core/src/except.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"};

0 comments on commit a1f4571

Please sign in to comment.