Re: [Boost-bugs] [Boost C++ Libraries] #3604: Access violation on diamond inheritance

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3604: Access violation on diamond inheritance
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-04-10 00:18:13

#3604: Access violation on diamond inheritance
  Reporter: kondo@… | Owner: ramey
      Type: Support Requests | Status: reopened
 Milestone: Boost 1.41.0 | Component: serialization
   Version: Boost 1.40.0 | Severity: Not Applicable
Resolution: | Keywords:

Comment(by kondo@…):

 I offer additional information.
 I believe that if the virtual inheritance inclusion distinguished
 correctly, static downcast from a virtual base class does not occur

 Because the void cast includes virtual inheritance case, the void cast
 code is dispatched below class.

 template <class Derived, class Base>
 class void_caster_virtual_base :
     public void_caster
     virtual bool has_virtual_base() const {
         return true;
     virtual void const * downcast(void const * const t) const {
         const Derived * d =
             dynamic_cast<const Derived *>(
                 static_cast<const Base *>(t)
         return d;
     virtual void const * upcast(void const * const t) const {
         const Base * b =
             dynamic_cast<const Base *>(
                 static_cast<const Derived *>(t)
         return b;
     virtual ~void_caster_virtual_base();

 And the void cast use dynamic_cast instead of static_cast.

Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC