------- 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