diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-10-10 19:22:04 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-10-10 19:22:04 +0000 |
commit | be4802181ab3e1a7be0529530bdfa4cef0dc404f (patch) | |
tree | 504c4e06b79418fa60f7c810af43f611b810689f /gcc/cp | |
parent | 49185df59b14346e76297d394f88ff13445f1299 (diff) | |
download | gcc-be4802181ab3e1a7be0529530bdfa4cef0dc404f.tar.gz |
* pt.c (instantiate_decl): Fix previous change.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@15888 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 18 |
2 files changed, 17 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0f703f19c58..d5d187f79db 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +Fri Oct 10 12:21:11 1997 Jason Merrill <jason@yorick.cygnus.com> + + * pt.c (instantiate_decl): Fix previous change. + Thu Oct 9 12:08:21 1997 Jason Merrill <jason@yorick.cygnus.com> * pt.c (tsubst): Fix thinko. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 4daf0522032..8e1e42c8342 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -623,8 +623,7 @@ check_explicit_specialization (declarator, decl, template_count, flags) member class template of a non-specialized class template is itself a template. - So, we just leave the template info alone in this case. - */ + So, we just leave the template info alone in this case. */ if (!(DECL_TEMPLATE_INFO (decl) && DECL_TI_TEMPLATE (decl))) DECL_TEMPLATE_INFO (decl) = perm_tree_cons (tmpl, targs, NULL_TREE); @@ -4411,9 +4410,6 @@ instantiate_decl (d) int line = lineno; char *file = input_filename; - if (DECL_TEMPLATE_SPECIALIZATION (d)) - return d; - for (td = tmpl; DECL_TEMPLATE_INSTANTIATION (td); ) td = DECL_TI_TEMPLATE (td); @@ -4437,6 +4433,18 @@ instantiate_decl (d) if (d_defined) return d; + if (TREE_CODE (d) == FUNCTION_DECL) + { + tree specs; + + /* Check to see if there is a matching specialization. */ + for (specs = DECL_TEMPLATE_SPECIALIZATIONS (tmpl); + specs != NULL_TREE; + specs = TREE_CHAIN (specs)) + if (comp_template_args (TREE_PURPOSE (specs), args)) + return TREE_VALUE (specs); + } + /* This needs to happen before any tsubsting. */ if (! push_tinst_level (d)) return d; |