* 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.
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]
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]
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);
}