decl2.c (check_member_template): Set DECL_IGNORED for member class templates, too.

* decl2.c (check_member_template): Set DECL_IGNORED for member
	class templates, too.

From-SVN: r19368
This commit is contained in:
Mark Mitchell 1998-04-21 22:03:34 +00:00 committed by Mark Mitchell
parent fb1653e1f8
commit 1701f21e52
2 changed files with 7 additions and 12 deletions

View File

@ -2,6 +2,9 @@ Tue Apr 21 22:00:04 1998 Mark Mitchell <mmitchell@usa.net>
* errfn.c (cp_thing): Use xrealloc, not xmalloc, to copy memory.
* decl2.c (check_member_template): Set DECL_IGNORED for member
class templates, too.
Tue Apr 21 18:59:11 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
* decl.c (duplicate_decls): Only check DECL_FRIEND_P if function.

View File

@ -1343,7 +1343,9 @@ check_member_template (tmpl)
my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 0);
decl = DECL_TEMPLATE_RESULT (tmpl);
if (TREE_CODE (decl) == FUNCTION_DECL)
if (TREE_CODE (decl) == FUNCTION_DECL
|| (TREE_CODE (decl) == TYPE_DECL
&& IS_AGGR_TYPE (TREE_TYPE (decl))))
{
if (current_function_decl)
/* 14.5.2.2 [temp.mem]
@ -1352,7 +1354,7 @@ check_member_template (tmpl)
cp_error ("declaration of of member template `%#D' in local class",
decl);
if (DECL_VIRTUAL_P (decl))
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl))
{
/* 14.5.2.3 [temp.mem]
@ -1367,16 +1369,6 @@ check_member_template (tmpl)
with member templates. */
DECL_IGNORED_P (tmpl) = 1;
}
else if (TREE_CODE (decl) == TYPE_DECL
&& IS_AGGR_TYPE (TREE_TYPE (decl)))
{
if (current_function_decl)
/* 14.5.2.2 [temp.mem]
A local class shall not have member templates. */
cp_error ("declaration of of member template `%#D' in local class",
decl);
}
else
cp_error ("template declaration of `%#D'", decl);
}