diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-12-11 05:15:37 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-12-11 05:15:37 +0000 |
commit | 4207de9361b3bbbd54b511a73bb801e46e05a7f9 (patch) | |
tree | cc4933ad581ab4304c447832882d2db3bc119e02 /gcc/cp | |
parent | ef08e594dc4f3a50e165180b784e69f8c9cab3bf (diff) | |
download | gcc-4207de9361b3bbbd54b511a73bb801e46e05a7f9.tar.gz |
* pt.c (instantiate_decl): Defer all templates but inline functions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17039 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 17 |
2 files changed, 13 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0ddfaf5f559..88732201b20 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +Wed Dec 10 11:04:45 1997 Jason Merrill <jason@yorick.cygnus.com> + + * pt.c (instantiate_decl): Defer all templates but inline functions. + Mon Dec 8 23:17:13 1997 Jason Merrill <jason@yorick.cygnus.com> * init.c (expand_vec_init): Don't fold a list of parameters. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c35dc208963..a68bf1fb6be 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4553,15 +4553,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; |