From c8f3579f936f9943a691cc65cda64bd70ba3ae9f Mon Sep 17 00:00:00 2001 From: Dmitry Kurtaev Date: Wed, 26 Sep 2018 16:08:51 +0300 Subject: [PATCH] Fix #12542 (#12603) * Fix #12542 * Remove ignore of non-virtual-dtor error --- modules/dnn/CMakeLists.txt | 1 - modules/dnn/src/onnx/onnx_importer.cpp | 2 +- modules/dnn/src/tensorflow/tf_graph_simplifier.cpp | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt index 1cb7c467f9..720f1a89ab 100644 --- a/modules/dnn/CMakeLists.txt +++ b/modules/dnn/CMakeLists.txt @@ -36,7 +36,6 @@ else() -Wunused-parameter -Wunused-local-typedefs -Wsign-compare -Wsign-promo -Wundef -Wtautological-undefined-compare -Wignored-qualifiers -Wextra -Wunused-function -Wunused-const-variable -Wdeprecated-declarations - -Werror=non-virtual-dtor ) endif() diff --git a/modules/dnn/src/onnx/onnx_importer.cpp b/modules/dnn/src/onnx/onnx_importer.cpp index 04b56f8df2..a9daa198df 100644 --- a/modules/dnn/src/onnx/onnx_importer.cpp +++ b/modules/dnn/src/onnx/onnx_importer.cpp @@ -213,7 +213,7 @@ LayerParams ONNXImporter::getLayerParams(const opencv_onnx::NodeProto& node_prot else if (attribute_proto.floats_size() > 0) { lp.set(attribute_name, DictValue::arrayReal( - (float*)attribute_proto.mutable_floats(), attribute_proto.floats_size())); + attribute_proto.floats().data(), attribute_proto.floats_size())); } else if (attribute_proto.ints_size() > 0) { diff --git a/modules/dnn/src/tensorflow/tf_graph_simplifier.cpp b/modules/dnn/src/tensorflow/tf_graph_simplifier.cpp index 2a34c2571d..5cf65c8304 100644 --- a/modules/dnn/src/tensorflow/tf_graph_simplifier.cpp +++ b/modules/dnn/src/tensorflow/tf_graph_simplifier.cpp @@ -20,6 +20,8 @@ using ::google::protobuf::MapPair; class Subgraph // Interface to match and replace TensorFlow subgraphs. { public: + virtual ~Subgraph() {} + // Add a node to be matched in the origin graph. Specify ids of nodes that // are expected to be inputs. Returns id of a newly added node. // TODO: Replace inputs to std::vector in C++11