[Bug c++/65292] Template function not emitted

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 3 10:16:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65292

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Khem Raj from comment #2)
> there is another file in same library where this file object resides which
> uses this function and reports undefined symbol errors when linking.

Then you either need to include the definition of the function template in that
other file, or provide an explicit instantiation.

You can't just rely on an implicit instantiation being emitted in some other
.cpp file.

> Has it been inlined and thrown away ?

Yes.

> then why the rest two were not. 

Because the optimizer decided to optimize them differently.



More information about the Gcc-bugs mailing list