Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-11-27 11:34:17


Hi,

When I switched Boost.Python from its own version of is_polymorphic to
the current type trait, I started getting the following warning from
GCC:

    c:/boost/boost/type_traits/is_polymorphic.hpp:22: warning: `struct
       boost::detail::is_polymorphic_imp1<V>::d1' has virtual functions but
       non-virtual destructor

So I just patched is_polymorphic.hpp as follows:

*** is_polymorphic.hpp 21 Nov 2002 08:46:49 -0000 1.4
--- is_polymorphic.hpp 27 Nov 2002 16:39:14 -0000 1.5
***************
*** 21,27 ****
--- 21,29 ----
     struct d1 : public ncvT
     {
        d1();
+ # if !defined(__GNUC__) // this raises warnings with some classes, and buys nothing with GCC
        ~d1()throw();
+ # endif
        char padding[256];
     };
     struct d2 : public ncvT

I assume the current definition of ~d1() is because some compilers
generate an implicit destructor with a non-empty
exception-specification, which then causes an error? I'm wondering if
we wouldn't be better off just defining ~d1 for those compilers, since
many other compilers are likely to raise the same warning as above.

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk