mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-29 02:14:55 +08:00
pt.c (push_template_decl): Complain about template with C linkage, anonymous template class.
* pt.c (push_template_decl): Complain about template with C linkage, anonymous template class. From-SVN: r18646
This commit is contained in:
parent
edcd669072
commit
c7dfe58480
@ -1,3 +1,8 @@
|
||||
Tue Mar 17 11:40:26 1998 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* pt.c (push_template_decl): Complain about template with C linkage,
|
||||
anonymous template class.
|
||||
|
||||
Mon Mar 16 12:10:39 1998 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX.
|
||||
|
@ -1369,6 +1369,11 @@ push_template_decl (decl)
|
||||
int is_friend = (TREE_CODE (decl) == FUNCTION_DECL
|
||||
&& DECL_FRIEND_P (decl));
|
||||
|
||||
if (current_lang_name == lang_name_c)
|
||||
cp_error ("template with C linkage");
|
||||
if (TREE_CODE (decl) == TYPE_DECL && ANON_AGGRNAME_P (DECL_NAME (decl)))
|
||||
cp_error ("template class without a name");
|
||||
|
||||
if (is_friend)
|
||||
/* For a friend, we want the context of the friend function, not
|
||||
the type of which it is a friend. */
|
||||
|
Loading…
Reference in New Issue
Block a user