]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* pt.c (instantiate_decl): Defer all templates but inline functions.
authorJason Merrill <jason@yorick.cygnus.com>
Sat, 20 Dec 1997 11:58:49 +0000 (11:58 +0000)
committerJeff Law <law@gcc.gnu.org>
Sat, 20 Dec 1997 11:58:49 +0000 (04:58 -0700)
From-SVN: r17159

gcc/cp/ChangeLog
gcc/cp/pt.c

index 14cd582b524cfad6965f82817dcd5df9ae3cffbb..7f0cc234c903074e801c862061a32b280d06bcc3 100644 (file)
@@ -1,3 +1,7 @@
+Sat Dec 20 13:00:30 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * pt.c (instantiate_decl): Defer all templates but inline functions.
+
 Fri Dec 19 09:37:26 1997  Jason Merrill  <jason@yorick.cygnus.com>
 
        * cp-tree.h (struct lang_decl_flags): Add comdat.
index 9e4512821fcdf1cba89988157323d9889932a68a..89a95a9216defd05f68aee6a18b8bf7d0c53e180 100644 (file)
@@ -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;