From 7cd3c8e86e9be1b09ba0adaca16c1b3647ade81d Mon Sep 17 00:00:00 2001 From: csy0225 <78470701+csy0225@users.noreply.github.com> Date: Wed, 2 Mar 2022 21:31:37 +0800 Subject: [PATCH] Fix compile problem when open -Wnon-virtual-dtor compile flag (#10705) * Fix compile problem when open -Wnon-virtual-dtor compile flag * update code style * fix the code style --- src/core/include/openvino/core/any.hpp | 2 ++ src/core/include/openvino/op/util/variable_extension.hpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/core/include/openvino/core/any.hpp b/src/core/include/openvino/core/any.hpp index f2c26c0e051dcf..3d98462e8cc1fb 100644 --- a/src/core/include/openvino/core/any.hpp +++ b/src/core/include/openvino/core/any.hpp @@ -541,6 +541,8 @@ class OPENVINO_API Any { template Impl(Args&&... args) : value(std::forward(args)...) {} + virtual ~Impl(){}; + const std::type_info& type_info() const override { return typeid(T); } diff --git a/src/core/include/openvino/op/util/variable_extension.hpp b/src/core/include/openvino/op/util/variable_extension.hpp index 25e8179fd36385..53dc533652c249 100644 --- a/src/core/include/openvino/op/util/variable_extension.hpp +++ b/src/core/include/openvino/op/util/variable_extension.hpp @@ -38,6 +38,9 @@ class OPENVINO_API VariableExtension { /// \brief Returns the identifier of corresponding variable. virtual std::string get_variable_id() const = 0; +protected: + virtual ~VariableExtension(){}; + protected: std::shared_ptr m_variable; };