Commit f2e48b67 by Brendan Kehoe Committed by Brendan Kehoe

pt.c (check_explicit_specialization): If DECLARATOR turned into an…

pt.c (check_explicit_specialization): If DECLARATOR turned into an error_mark_node from lookup_template_function...

	* pt.c (check_explicit_specialization): If DECLARATOR turned into
	an error_mark_node from lookup_template_function, return the same.
	(determine_specialization): Also make sure TEMPLATE_ID isn't an
	error_mark_node, before we try to read its operands.
	* decl.c (grokdeclarator): If we got an error_mark_node from
	check_explicit_specialization, just return it right back.

From-SVN: r20444
parent 38831dfe
1998-06-12 Brendan Kehoe <brendan@cygnus.com>
* pt.c (check_explicit_specialization): If DECLARATOR turned into
an error_mark_node from lookup_template_function, return the same.
(determine_specialization): Also make sure TEMPLATE_ID isn't an
error_mark_node, before we try to read its operands.
* decl.c (grokdeclarator): If we got an error_mark_node from
check_explicit_specialization, just return it right back.
1998-06-12 Mark Mitchell <mark@markmitchell.com> 1998-06-12 Mark Mitchell <mark@markmitchell.com>
* class.c (instantiate_type): Don't treat template-ids that don't * class.c (instantiate_type): Don't treat template-ids that don't
......
...@@ -10193,6 +10193,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10193,6 +10193,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (decl == NULL_TREE) if (decl == NULL_TREE)
return NULL_TREE; return NULL_TREE;
/* Among other times, could occur from check_explicit_specialization
returning an error_mark_node. */
if (decl == error_mark_node)
return error_mark_node;
if (ctype == NULL_TREE && DECL_LANGUAGE (decl) != lang_c if (ctype == NULL_TREE && DECL_LANGUAGE (decl) != lang_c
&& (! DECL_USE_TEMPLATE (decl) || && (! DECL_USE_TEMPLATE (decl) ||
name_mangling_version < 1)) name_mangling_version < 1))
......
...@@ -784,14 +784,19 @@ determine_specialization (template_id, decl, targs_out, ...@@ -784,14 +784,19 @@ determine_specialization (template_id, decl, targs_out,
int need_member_template; int need_member_template;
int complain; int complain;
{ {
tree fns = TREE_OPERAND (template_id, 0); tree fns, targs_in;
tree targs_in = TREE_OPERAND (template_id, 1);
tree templates = NULL_TREE; tree templates = NULL_TREE;
tree fn; tree fn;
int i; int i;
*targs_out = NULL_TREE; *targs_out = NULL_TREE;
if (template_id == error_mark_node)
return error_mark_node;
fns = TREE_OPERAND (template_id, 0);
targs_in = TREE_OPERAND (template_id, 1);
if (fns == error_mark_node) if (fns == error_mark_node)
return error_mark_node; return error_mark_node;
...@@ -1084,6 +1089,9 @@ check_explicit_specialization (declarator, decl, template_count, flags) ...@@ -1084,6 +1089,9 @@ check_explicit_specialization (declarator, decl, template_count, flags)
lookup_template_function (fns, NULL_TREE); lookup_template_function (fns, NULL_TREE);
} }
if (declarator == error_mark_node)
return error_mark_node;
if (TREE_CODE (TREE_OPERAND (declarator, 0)) == LOOKUP_EXPR) if (TREE_CODE (TREE_OPERAND (declarator, 0)) == LOOKUP_EXPR)
{ {
/* A friend declaration. We can't do much, because we don't /* A friend declaration. We can't do much, because we don't
......
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