Re: [Boost-bugs] [Boost C++ Libraries] #10462: throw exception inherits two std::exception

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10462: throw exception inherits two std::exception
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-09-05 03:03:19


#10462: throw exception inherits two std::exception
-------------------------------------+------------------------------------
  Reporter: gilles.guerre-chaley@… | Owner: emildotchevski
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: exception
   Version: Boost 1.56.0 | Severity: Optimization
Resolution: | Keywords: visual studio 2013 x64
-------------------------------------+------------------------------------

Comment (by emildotchevski):

 There are checks which should fail with ambiguous implicit conversion
 errors in case std::exception is derived from multiple times. I'm
 noticing, however, that the relevant unit test throw_exception_test.cpp
 doesn't explicitly verify this.

 Could you help me diagnose the error? Insert the following snipped into
 throw_exception_test.cpp, run it, and let me know if it fails for you. It
 works on my darwin build (the idea of this insertion is that if
 std::exception is derived from multiple times, the catch(std::exception&)
 would fail since the conversion would be ambiguous.)


 {{{
 @@ -76,7 +76,21 @@ throw_fwd( void (*thrower)(int) )
      {
      try
          {
 - thrower(42);
 + try
 + {
 + thrower(42);
 + }
 + catch(
 + std::exception & )
 + {
 + throw;
 + }
 + catch(
 + ... )
 + {
 + BOOST_ERROR("throw_fwd failed to catch std::exception,
 possibly because it was derived from multiply.");
 + throw;
 + }
          }
      catch(
      boost::exception & x )

 }}}

 Thanks,
 Emil

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10462#comment:1>
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-02-16 18:50:16 UTC