aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-03-17 12:20:38 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-03-17 07:20:38 -0500
commitc7dfe584801a38a984c279332c63e8fb41af4294 (patch)
treedabddfa3ed6bcc4a893f84e2b95f77d89abdbafb /gcc
parentedcd669072bdfccf47020cc6925af2cc620d411c (diff)
downloadgcc-c7dfe584801a38a984c279332c63e8fb41af4294.zip
gcc-c7dfe584801a38a984c279332c63e8fb41af4294.tar.gz
gcc-c7dfe584801a38a984c279332c63e8fb41af4294.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 94de5c0..4650586 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f261edf..6cc0aa3 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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. */