Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-05-02 12:51:44


Neal Becker:
> ./boost/exception/enable_error_info.hpp: In instantiation of
> boost::exception_detail::error_info_injector<boost::archive::archive_exception::exception_code>
> :
> ./boost/throw_exception.hpp:45: instantiated from void
> boost::throw_exception(const E&) [with E =
> boost::archive::archive_exception::exception_code]
> ./boost/archive/impl/xml_iarchive_impl.ipp:146: instantiated from void
> boost::archive::xml_iarchive_impl<Archive>::load_override(boost::archive::class_name_type&,
> int) [with Archive = boost::archive::naked_xml_iarchive]
> libs/serialization/src/xml_iarchive.cpp:38: instantiated from here
> ./boost/exception/enable_error_info.hpp:22: error: base type
> boost::archive::archive_exception::exception_code fails to be a struct or
> class type

This is (pedantically speaking) a bug in the new throw_exception (it doesn't
allow throwing non-class types) that exposes a bug in the serialization
library (it throws the invalid_class_name enum value directly instead of
constructing an archive_exception from it).

It might be a good idea to retain the throw_exception "bug" as a feature to
catch similar mistakes. Throwing a non-class is rarely intentional.

I've applied the obvious fix to the xml_(w)iarchive_impl.ipp that allows me
to build the serialization library. I'm sure that Robert will correct me if
I've done something wrong. :-)


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