This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/38828] g++ 4.3.2: -O2 without -fno-inline-small-functions makes some template instantiations disappear
- From: "ronan dot lehy at probayes dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jan 2009 15:13:13 -0000
- Subject: [Bug c++/38828] g++ 4.3.2: -O2 without -fno-inline-small-functions makes some template instantiations disappear
- References: <bug-38828-17180@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from ronan dot lehy at probayes dot com 2009-01-15 15:13 -------
If I add simple explicit instantiations in place or in addition to the
BOOST_CLASS_EXPORT() calls, all symbols are correctly exposed in all cases :
namespace boost {
namespace serialization {
template void
serialize<boost::archive::xml_iarchive>(boost::archive::xml_iarchive &, A &,
unsigned int);
template void
serialize<boost::archive::xml_iarchive>(boost::archive::xml_iarchive &, B &,
unsigned int);
} }
Therefore, there may be a problem related to the way BOOST_CLASS_EXPORT()
instantiates serialize<>(). BOOST_CLASS_EXPORT(A) expands to:
namespace boost { namespace archive { namespace detail {
template<> const guid_initializer< A >
guid_initializer< A >::instance("A");
template std::pair<
const export_generator<
A, boost::archive::detail::known_archive_types::type> *,
const guid_initializer< A > *>
export_archives_invoke<
A, boost::archive::detail::known_archive_types::type>
(A &, boost::archive::detail::known_archive_types::type &);
} } };
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38828