Work around msvc bug when explicitly destroying a class with a virtual base. Fixes #5940.

[SVN r82915]
This commit is contained in:
Steven Watanabe
2013-02-15 19:22:34 +00:00
parent e40c2654d9
commit ff48f2b3a0
2 changed files with 9 additions and 1 deletions

View File

@ -840,11 +840,19 @@ void test_with_builtin_types()
test_none( ARG(double) ) ;
}
// MSVC < 11.0 doesn't destroy X when we call ptr->VBase::VBase.
// Make sure that we work around this bug.
struct VBase : virtual X
{
VBase(int v) : X(v) {}
};
void test_with_class_type()
{
TRACE( std::endl << BOOST_CURRENT_FUNCTION );
test_basics( ARG(X) );
test_basics( ARG(VBase) );
test_conditional_ctor_and_get_valur_or( ARG(X) );
test_direct_value_manip( ARG(X) );
test_uninitialized_access( ARG(X) );