Boost C++ Libraries: Ticket #12097: missing virtual destructor https://svn.boost.org/trac10/ticket/12097 <p> When compiling my program with g++ -Wdelete-non-virtual-dtor -Wsystem-headers I get warnings about a missing virtual destructor in boost. I recommend making the destructor of error_info_container virtual to avoid undefined behavior and to prevent memory leaks: </p> <p> file exception/exception.hpp: </p> <p> <strong>virtual</strong> ~error_info_container() throw() { } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12097 Trac 1.4.3 Steven Watanabe Fri, 25 Mar 2016 15:09:47 GMT <link>https://svn.boost.org/trac10/ticket/12097#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12097#comment:1</guid> <description> <p> There is no undefined behavior. This destructor is never used in a way that requires it to be virtual. </p> </description> <category>Ticket</category> </item> <item> <author>josopait@…</author> <pubDate>Fri, 25 Mar 2016 16:36:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12097#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12097#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12097#comment:1" title="Comment 1">steven_watanabe</a>: </p> <blockquote class="citation"> <p> There is no undefined behavior. This destructor is never used in a way that requires it to be virtual. </p> </blockquote> <p> Are you sure? The line </p> <blockquote> <p> delete this; </p> </blockquote> <p> in file exception/info.hpp does look suspicious. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Fri, 25 Mar 2016 16:49:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12097#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12097#comment:3</guid> <description> <p> Yes, I'm sure. There are no derived classes of error_info_container_impl. </p> </description> <category>Ticket</category> </item> <item> <author>josopait@…</author> <pubDate>Fri, 25 Mar 2016 16:57:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12097#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12097#comment:4</guid> <description> <p> Ok, then it should be safe. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Wed, 26 Oct 2016 19:32:58 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/12097#comment:5 https://svn.boost.org/trac10/ticket/12097#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> Ticket