Commit a1da6cba by Mark Mitchell Committed by Mark Mitchell

pt.c (finish_member_template_decl): Deal more gracefully with invalid declarations.

	* pt.c (finish_member_template_decl): Deal more gracefully with
	invalid declarations.

From-SVN: r18399
parent 1dd8faa8
Wed Mar 4 11:28:08 1998 Mark Mitchell <mmitchell@usa.net>
* pt.c (finish_member_template_decl): Deal more gracefully with
invalid declarations.
Tue Mar 3 01:38:17 1998 Jason Merrill <jason@yorick.cygnus.com> Tue Mar 3 01:38:17 1998 Jason Merrill <jason@yorick.cygnus.com>
* call.c, class.c, cp-tree.h, cvt.c, decl.c, init.c, lex.c, * call.c, class.c, cp-tree.h, cvt.c, decl.c, init.c, lex.c,
......
...@@ -118,14 +118,21 @@ finish_member_template_decl (template_parameters, decl) ...@@ -118,14 +118,21 @@ finish_member_template_decl (template_parameters, decl)
} }
return NULL_TREE; return NULL_TREE;
} }
else if (DECL_TEMPLATE_INFO (decl) && else if (DECL_TEMPLATE_INFO (decl))
!DECL_TEMPLATE_SPECIALIZATION (decl))
{ {
check_member_template (DECL_TI_TEMPLATE (decl)); if (!DECL_TEMPLATE_SPECIALIZATION (decl))
return DECL_TI_TEMPLATE (decl); {
} check_member_template (DECL_TI_TEMPLATE (decl));
return DECL_TI_TEMPLATE (decl);
}
else
return decl;
}
else
cp_error ("invalid member template declaration `%D'", decl);
return decl; return error_mark_node;
} }
/* Returns the template nesting level of the indicated class TYPE. /* Returns the template nesting level of the indicated class TYPE.
......
// Build don't link:
class A
{
template<class T>T epsilon; // ERROR - invalid member template
}; // ERROR - the compiler crashes here
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