[Boost-bugs] [Boost C++ Libraries] #13227: exception.hpp : disable false warning C4265 given by Visual Studio

Subject: [Boost-bugs] [Boost C++ Libraries] #13227: exception.hpp : disable false warning C4265 given by Visual Studio
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-09-21 18:30:26


#13227: exception.hpp : disable false warning C4265 given by Visual Studio
---------------------------------------+-----------------------------
 Reporter: Pascal Thomet <pthomet@…> | Owner: Emil Dotchevski
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: exception
  Version: Boost 1.64.0 | Severity: Problem
 Keywords: |
---------------------------------------+-----------------------------
 Hi,

 MSVC falsely report a missing virtual destructor inside exception.hpp
 Would it be possible to add a "pragma warning (disable:4265)" in this file
 ?
 This will *not* happen with the default settings of Visual Studio : it
 happens when trying
 to raise the warning level (/we4265 : treat "misssing virtual destructor"
 as an error)

 Steps to reproduce the problem :

 - Compile the following program:
 {{{

 #include <string>
 #include <iostream>
 #include <boost/optional/optional.hpp>

 int main(int argc, char **argv)
 {
   boost::optional<std::string> name;
   if (argc > 1)
     name.reset(argv[1]);

   if (name.is_initialized())
     std::cout << "Hello, " << name.get() << "\n";
   else
     std::cout << "Hello, world \n";
   return 0;
 }

 }}}

 - With the following command line :
 {{{
   cl hello.cpp /Iboost_1_64_0 /EHa /W3 /we4265
 }}}

 outputs

 {{{

 c:\tmp>cl hello.cpp /Iboost_1_64_0 /EHa /W3 /we4265
 Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x86
 Copyright (C) Microsoft Corporation. All rights reserved.
 hello.cpp
 boost_1_64_0\boost/exception/exception.hpp(176): error C4265:
 'boost::exception_detail::error_info_container': class has virtual
 functions, but destructor is not virtual
          instances of this class may not be destructed correctly

 }}}

 For more details, please also refer to
 https://github.com/ivsgroup/boost_warnings_minimal_demo

 The problem occurs with boost 1.64 and 1.62.

 Thanks & regards !

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13227>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-09-21 18:36:50 UTC