[opencv] 35/251: core/bufferpool.hpp: let msvc accept a non virtual protected destructor

Nobuhiro Iwamatsu iwamatsu at moszumanska.debian.org
Sun Aug 27 23:27:21 UTC 2017


This is an automated email from the git hooks/post-receive script.

iwamatsu pushed a commit to annotated tag 3.3.0
in repository opencv.

commit 309c9621694664430ec2b358460bcd60b5e826bc
Author: Pascal Thomet <pthomet at ivsweb.com>
Date:   Fri Jul 7 21:04:12 2017 +0200

    core/bufferpool.hpp: let msvc accept a non virtual protected destructor
    
    BufferPoolController has a non virtual protected destructor (which is legitimate)
    
    However, Visual Studio sees this as a bug, if you enable more warnings, like below
    ```
    add_compile_options(/W3)     # level 3 warnings
    add_compile_options(/we4265) # warning about missing virtual destructors
    ```
    
    This is a proposition in order to silence this warning.
    
    See https://github.com/ivsgroup/boost_warnings_minimal_demo for a demo of the same problem
    with boost/exception.hpp
---
 modules/core/include/opencv2/core/bufferpool.hpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/core/include/opencv2/core/bufferpool.hpp b/modules/core/include/opencv2/core/bufferpool.hpp
index 9e7b7c2..4698e5d 100644
--- a/modules/core/include/opencv2/core/bufferpool.hpp
+++ b/modules/core/include/opencv2/core/bufferpool.hpp
@@ -7,6 +7,11 @@
 #ifndef OPENCV_CORE_BUFFER_POOL_HPP
 #define OPENCV_CORE_BUFFER_POOL_HPP
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4265)
+#endif
+
 namespace cv
 {
 
@@ -28,4 +33,8 @@ public:
 
 }
 
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
 #endif // OPENCV_CORE_BUFFER_POOL_HPP

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git



More information about the debian-science-commits mailing list