This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/25369] [3.4/4.0/4.1/4.2 Regression] use of inline function in template class leads to undefined reference



------- Comment #10 from mmitchel at gcc dot gnu dot org  2005-12-22 20:51 -------
The problem here is that:

1. mark_used doesn't add inline functions to the deferred function list if
processing_template_decl.  (I guess this is a compile-time optimization, so
that the deferred function list isn't full of stuff that's only used in
uninstantiated templates.)

2. Kriang's patch means that during template instantiation there's no
substitution required; we've already resolved A<int>::foo.  So, we do no
lookup, and therefore, do not call mark_used again.  But, we don't want to do
lookup again, so Kriang's patch is a good thing.

I think the optimization in (1) is unsafe -- for exactly this test case.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]