diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-03-18 02:30:09 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-03-18 02:30:09 +0000 |
commit | 1f3fed0b4c910ef49f0f1ee675d2c1606ab1c122 (patch) | |
tree | baebbbd94b6003c736321515284c285aa74848a0 | |
parent | a15ec2b83666aac2ba3130738abb1249fa4c91b3 (diff) | |
download | gcc-1f3fed0b4c910ef49f0f1ee675d2c1606ab1c122.tar.gz |
* pt.c (push_template_decl): Only check primary templates.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18653 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/cp/pt.c | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 31dcfe42b54..216ced7007b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ Wed Mar 18 00:24:10 1998 Jason Merrill <jason@yorick.cygnus.com> + * pt.c (push_template_decl): Only check primary templates. + * pt.c (check_explicit_specialization): Complain about default args in explicit specialization. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 30b4054d655..13fd811c785 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1381,11 +1381,6 @@ 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. */ @@ -1416,6 +1411,14 @@ push_template_decl (decl) else primary = 0; + if (primary) + { + 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"); + } + /* Partial specialization. */ if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl) && CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl))) |