|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55428 - in trunk: boost/type_traits libs/type_traits/test
From: john_at_[hidden]
Date: 2009-08-06 04:54:46
Author: johnmaddock
Date: 2009-08-06 04:54:45 EDT (Thu, 06 Aug 2009)
New Revision: 55428
URL: http://svn.boost.org/trac/boost/changeset/55428
Log:
Fixes #3317.
Fix is_virtual_base_of so it doesn't lose exception specifications on it's destructors (causes GCC and maybe other compilers to choke).
Text files modified:
trunk/boost/type_traits/is_virtual_base_of.hpp | 8 ++++----
trunk/libs/type_traits/test/is_virtual_base_of_test.cpp | 18 ++++++++++++++++++
trunk/libs/type_traits/test/test.hpp | 1 +
3 files changed, 23 insertions(+), 4 deletions(-)
Modified: trunk/boost/type_traits/is_virtual_base_of.hpp
==============================================================================
--- trunk/boost/type_traits/is_virtual_base_of.hpp (original)
+++ trunk/boost/type_traits/is_virtual_base_of.hpp 2009-08-06 04:54:45 EDT (Thu, 06 Aug 2009)
@@ -42,14 +42,14 @@
X();
X(const X&);
X& operator=(const X&);
- ~X();
+ ~X()throw();
};
struct Y : public virtual Derived
{
Y();
Y(const Y&);
Y& operator=(const Y&);
- ~Y();
+ ~Y()throw();
};
#else
struct X : Derived, virtual Base
@@ -57,14 +57,14 @@
X();
X(const X&);
X& operator=(const X&);
- ~X();
+ ~X()throw();
};
struct Y : Derived
{
Y();
Y(const Y&);
Y& operator=(const Y&);
- ~Y();
+ ~Y()throw();
};
#endif
BOOST_STATIC_CONSTANT(bool, value = (sizeof(X)==sizeof(Y)));
Modified: trunk/libs/type_traits/test/is_virtual_base_of_test.cpp
==============================================================================
--- trunk/libs/type_traits/test/is_virtual_base_of_test.cpp (original)
+++ trunk/libs/type_traits/test/is_virtual_base_of_test.cpp 2009-08-06 04:54:45 EDT (Thu, 06 Aug 2009)
@@ -9,6 +9,21 @@
#include "check_integral_constant.hpp"
#include <boost/type_traits/is_virtual_base_of.hpp>
+// for bug report 3317: https://svn.boost.org/trac/boost/ticket/3317
+class B
+{
+public:
+ B();
+ virtual ~B()throw();
+};
+
+class D : public B
+{
+public:
+ D();
+ virtual ~D()throw();
+};
+
TT_TEST_BEGIN(is_virtual_base_of)
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<Derived,Base>::value), false);
@@ -42,6 +57,9 @@
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<virtual_inherit4,boost::noncopyable>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<int_convertible,virtual_inherit5>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<virtual_inherit5,int_convertible>::value), false);
+BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<Base,virtual_inherit6>::value), true);
+BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<virtual_inherit6,Base>::value), false);
+BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<B,D>::value), false);
TT_TEST_END
Modified: trunk/libs/type_traits/test/test.hpp
==============================================================================
--- trunk/libs/type_traits/test/test.hpp (original)
+++ trunk/libs/type_traits/test/test.hpp 2009-08-06 04:54:45 EDT (Thu, 06 Aug 2009)
@@ -370,6 +370,7 @@
struct virtual_inherit3 : private virtual Base {};
struct virtual_inherit4 : virtual boost::noncopyable {};
struct virtual_inherit5 : virtual int_convertible {};
+struct virtual_inherit6 : virtual Base { virtual ~virtual_inherit6()throw(); };
typedef void foo0_t();
typedef void foo1_t(int);
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk