[Bug c++/54145] [4.7/4.8 Regression] no symbol generated for `void QMailThreadSortKey::deserialize<QDataStream>(QDataStream&)'

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Sep 19 12:30:00 GMT 2012


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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jason at gcc dot gnu.org
         Resolution|                            |INVALID

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-19 12:30:19 UTC ---
This happens because -O2 now includes -finline-small-functions, so the call to
deserialize from operator>> is inlined.  Since deserialize is an implicit
instantiation, the compiler only emits it in places where it is needed, and it
isn't needed in this translation unit because all uses have been inlined.

G++ expects that the definition of a template will be available in all
translation units that use it unless it is explicitly instantiated.

You can use -O2 -fno-inline-small-functions to restore the older behavior.



More information about the Gcc-bugs mailing list