------- Comment #10 from bangerth at gmail dot com  2009-01-30 15:37 -------
(In reply to comment #9)
> Following the twisted maze that is BOOST_CLASS_EXPORT() leads me to think that
> it is (very) roughly equivalent to this:
> 
> void dummy(boost::archive::xml_iarchive & ar, A & a, B & b) {
>     boost::serialization::serialize(ar, a, 0);
>     boost::serialization::serialize(ar, b, 0);
> }
> 
> Indeed, replacing my BOOST_CLASS_EXPORT() calls with this, I get the same
> effect ("disappearing" symbols with -O2).
> 
> At this point, my question is: is triggering template instantiations in this
> way supposed to be equivalent to explicit instantiations (as in comment #8)
> with respect to symbols exposed to the outside? If the answer is no, thank you
> very much for your help and sorry for the trouble.

The answer is no. The code requires the *implicit* instantiation of some code
but the compiler only needs to instantiate whatever it needs and is free
to eliminate what it doesn't. In fact, there is no guarantee that any code
visible outside this one object file is generated at all.

W.


-- 

bangerth at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at gmail dot com
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38828

Reply via email to