This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
(C++) patch to mark_used
- To: gcc-patches at gcc dot gnu dot org
- Subject: (C++) patch to mark_used
- From: Jason Merrill <jason at cygnus dot com>
- Date: Mon, 24 Jan 2000 21:29:13 -0800
This patch fixes inlining of op<< in
#include <iomanip.h>
void
f()
{
cout << setw(3);
}
Mark, what was the rationale for preventing instantiation of explicits at
this point, rather than letting the linkage cover it?
2000-01-24 Jason Merrill <jason@casey.cygnus.com>
* decl2.c (mark_used): Do instantiate inlines that have been
explicitly instantiated.
Index: decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.300
diff -c -p -r1.300 decl2.c
*** decl2.c 2000/01/19 11:34:03 1.300
--- decl2.c 2000/01/25 05:27:24
*************** mark_used (decl)
*** 5181,5187 ****
instantiation because that is not checked in instantiate_decl. */
if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL)
&& DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)
! && !DECL_EXPLICIT_INSTANTIATION (decl))
instantiate_decl (decl);
}
--- 5181,5188 ----
instantiation because that is not checked in instantiate_decl. */
if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL)
&& DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)
! && (!DECL_EXPLICIT_INSTANTIATION (decl)
! || (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))))
instantiate_decl (decl);
}