Boost C++ Libraries: Ticket #3411: Warnings when boost::exception is compiled with "-Wold-style-cast" https://svn.boost.org/trac10/ticket/3411 <p> Boost::exception reports warnings when compiled with "-Wold-style-cast". </p> <p> Please see ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2983" title="#2983: Bugs: BOOST_CHECK_EQUAL gives error (or warning) &#34;use of old-style cast&#34; ... (closed: fixed)">#2983</a> which is very similar to this one. </p> <p> The following code example reproduces the issue with Boost 1.40: </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/exception.hpp&gt; typedef boost::error_info&lt;struct tag_my_info,int&gt; my_info; struct my_error: virtual boost::exception, virtual std::exception { }; void f() { throw my_error() &lt;&lt; my_info(42); } void g() { try { f(); } catch( my_error &amp; x ) { if( int const * mi=boost::get_error_info&lt;my_info&gt;(x) ) std::cerr &lt;&lt; "My info: " &lt;&lt; *mi; } } </pre><p> The piece of code for this bug report has been compiled with g++ (GCC) 3.4.3:<br /> g++ -Wold-style-cast -o Example -I&lt;PATH_TO_BOOST&gt; Example.cpp </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3411 Trac 1.4.3 c-rom (-at-) gmx.de Mon, 07 Sep 2009 10:13:41 GMT <link>https://svn.boost.org/trac10/ticket/3411#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3411#comment:1</guid> <description> <p> Oops, forgot the main()... </p> <pre class="wiki">int main( int argc, char** argv ) { g(); return 0; } </pre><p> ;-) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Mon, 07 Sep 2009 21:24:51 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3411#comment:2 https://svn.boost.org/trac10/ticket/3411#comment:2 <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> <p> Strictly speaking, this is not a cast. I don't plan on "fixing" this. </p> Ticket