This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25369] [3.4/4.0/4.1/4.2 Regression] use of inline function in template class leads to undefined reference
- From: "mmitchel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Dec 2005 20:51:06 -0000
- Subject: [Bug c++/25369] [3.4/4.0/4.1/4.2 Regression] use of inline function in template class leads to undefined reference
- References: <bug-25369-11868@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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