Commit 27bb8339 by Jason Merrill Committed by Jason Merrill

pt.c (instantiate_decl): Look for the original template.

Mon Oct  6 09:27:29 1997  Jason Merrill  <jason@yorick.cygnus.com>

	* pt.c (instantiate_decl): Look for the original template.
	(tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations
	of member templates.

Fixes tstring.

From-SVN: r15838
parent d8d64559
Mon Oct 6 09:27:29 1997 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (instantiate_decl): Look for the original template.
(tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations
of member templates.
Wed Oct 1 08:41:38 1997 Jason Merrill <jason@yorick.cygnus.com> Wed Oct 1 08:41:38 1997 Jason Merrill <jason@yorick.cygnus.com>
* Makefile.in (g++FAQ.*): New rules. * Makefile.in (g++FAQ.*): New rules.
......
...@@ -2881,9 +2881,6 @@ finish_file () ...@@ -2881,9 +2881,6 @@ finish_file ()
at_eof = 1; at_eof = 1;
if (flag_detailed_statistics)
dump_tree_statistics ();
/* Bad parse errors. Just forget about it. */ /* Bad parse errors. Just forget about it. */
if (! global_bindings_p () || current_class_type) if (! global_bindings_p () || current_class_type)
return; return;
...@@ -3306,7 +3303,10 @@ finish_file () ...@@ -3306,7 +3303,10 @@ finish_file ()
varconst_time += this_time - start_time; varconst_time += this_time - start_time;
if (flag_detailed_statistics) if (flag_detailed_statistics)
dump_time_statistics (); {
dump_tree_statistics ();
dump_time_statistics ();
}
} }
/* This is something of the form 'A()()()()()+1' that has turned out to be an /* This is something of the form 'A()()()()()+1' that has turned out to be an
......
...@@ -465,8 +465,7 @@ determine_explicit_specialization (template_id, type, targs_out, ...@@ -465,8 +465,7 @@ determine_explicit_specialization (template_id, type, targs_out,
is an explicit instantiation. */ is an explicit instantiation. */
int int
check_explicit_specialization(declarator, decl, template_count, check_explicit_specialization (declarator, decl, template_count, flags)
flags)
tree declarator; tree declarator;
tree decl; tree decl;
int template_count; int template_count;
...@@ -2207,7 +2206,8 @@ tsubst (t, args, nargs, in_decl) ...@@ -2207,7 +2206,8 @@ tsubst (t, args, nargs, in_decl)
DECL_INITIAL (new_decl) = DECL_INITIAL (decl); DECL_INITIAL (new_decl) = DECL_INITIAL (decl);
DECL_TI_TEMPLATE (new_decl) = tmpl; DECL_TI_TEMPLATE (new_decl) = tmpl;
TREE_TYPE (tmpl) = TREE_TYPE (new_decl); TREE_TYPE (tmpl) = TREE_TYPE (new_decl);
DECL_TEMPLATE_INSTANTIATIONS(tmpl) = NULL_TREE; DECL_TEMPLATE_INSTANTIATIONS (tmpl) = NULL_TREE;
SET_DECL_IMPLICIT_INSTANTIATION (decl);
/* The template parameters for this new template are all the /* The template parameters for this new template are all the
template parameters for the old template, except the template parameters for the old template, except the
...@@ -4411,7 +4411,7 @@ instantiate_decl (d) ...@@ -4411,7 +4411,7 @@ instantiate_decl (d)
tree tmpl = TI_TEMPLATE (ti); tree tmpl = TI_TEMPLATE (ti);
tree args = TI_ARGS (ti); tree args = TI_ARGS (ti);
tree td; tree td;
tree pattern = DECL_TEMPLATE_RESULT (tmpl); tree pattern;
tree save_ti; tree save_ti;
int nested = in_function_p (); int nested = in_function_p ();
int d_defined; int d_defined;
...@@ -4419,6 +4419,11 @@ instantiate_decl (d) ...@@ -4419,6 +4419,11 @@ instantiate_decl (d)
int line = lineno; int line = lineno;
char *file = input_filename; char *file = input_filename;
while (DECL_TEMPLATE_INSTANTIATION (tmpl))
tmpl = DECL_TI_TEMPLATE (tmpl);
pattern = DECL_TEMPLATE_RESULT (tmpl);
if (TREE_CODE (d) == FUNCTION_DECL) if (TREE_CODE (d) == FUNCTION_DECL)
{ {
d_defined = (DECL_INITIAL (d) != NULL_TREE); d_defined = (DECL_INITIAL (d) != NULL_TREE);
......
...@@ -1660,6 +1660,7 @@ print_lang_statistics () ...@@ -1660,6 +1660,7 @@ print_lang_statistics ()
print_obstack_statistics ("decl_obstack", &decl_obstack); print_obstack_statistics ("decl_obstack", &decl_obstack);
print_obstack_statistics ("permanent_obstack", &permanent_obstack); print_obstack_statistics ("permanent_obstack", &permanent_obstack);
print_obstack_statistics ("maybepermanent_obstack", &maybepermanent_obstack); print_obstack_statistics ("maybepermanent_obstack", &maybepermanent_obstack);
print_inline_obstack_statistics ();
print_search_statistics (); print_search_statistics ();
print_class_statistics (); print_class_statistics ();
#ifdef GATHER_STATISTICS #ifdef GATHER_STATISTICS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment