Subject: [Boost-bugs] [Boost C++ Libraries] #13467: RTTI issue with non-polymorphic types in debug mode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-03-05 18:09:14
#13467: RTTI issue with non-polymorphic types in debug mode
--------------------------------+---------------------------
Reporter: jlodos@⦠| Owner: Robert Ramey
Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
Version: Boost 1.67.0 | Severity: Problem
Keywords: serialization rtti |
--------------------------------+---------------------------
While serializing non-polymorphic types without RTTI in debug mode you get
compiler warnings and execution crashes. In release mode everything works
fine.
This is because dynamic_cast is used for debugging purposes.
The code is in smart_cast.hpp, starting in line 87:
{{{
#if ! defined(NDEBUG) \
|| defined(__MWERKS__)
// do a checked dynamic cast
return cross::cast(u);
#else
}}}
I believe the first line could be replaced with:
{{{
#if (! defined(NDEBUG) && ! defined(BOOST_NO_RTTI) ) \
}}}
This solved the issue for me.
-- Ticket URL: <https://svn.boost.org/trac10/ticket/13467> 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 : 2018-03-05 18:15:03 UTC