From: Jason Merrill Date: Sat, 20 Dec 1997 11:58:49 +0000 (+0000) Subject: * pt.c (instantiate_decl): Defer all templates but inline functions. X-Git-Tag: prereleases/egcs-1.0.1-prerelease~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d77f84b24653c9bf6f3ae1227941b7767ee23d9c;p=thirdparty%2Fgcc.git * pt.c (instantiate_decl): Defer all templates but inline functions. From-SVN: r17159 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 14cd582b524c..7f0cc234c903 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +Sat Dec 20 13:00:30 1997 Jason Merrill + + * pt.c (instantiate_decl): Defer all templates but inline functions. + Fri Dec 19 09:37:26 1997 Jason Merrill * cp-tree.h (struct lang_decl_flags): Add comdat. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 9e4512821fcd..89a95a9216de 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4530,15 +4530,16 @@ instantiate_decl (d) import_export_decl (d); } + /* Reject all external templates except inline functions. */ + if (DECL_INTERFACE_KNOWN (d) + && ! DECL_NOT_REALLY_EXTERN (d) + && ! (TREE_CODE (d) == FUNCTION_DECL && DECL_INLINE (d))) + goto out; + + /* Defer all templates except inline functions used in another function. */ if (! pattern_defined - || (TREE_CODE (d) == FUNCTION_DECL && ! DECL_INLINE (d) - && (! DECL_INTERFACE_KNOWN (d) - || ! DECL_NOT_REALLY_EXTERN (d))) - /* Kludge: if we compile a constructor in the middle of processing a - toplevel declaration, we blow away the declspecs in - temp_decl_obstack when we call permanent_allocation in - finish_function. So don't compile it yet. */ - || (TREE_CODE (d) == FUNCTION_DECL && ! nested && ! at_eof)) + || (! (TREE_CODE (d) == FUNCTION_DECL && DECL_INLINE (d) && nested) + && ! at_eof)) { add_pending_template (d); goto out;