* pt.c (push_template_decl): Only check primary templates.
From-SVN: r18653
This commit is contained in:
parent
670960acd3
commit
83566abf9f
|
@ -1,5 +1,7 @@
|
||||||
Wed Mar 18 00:24:10 1998 Jason Merrill <jason@yorick.cygnus.com>
|
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
|
* pt.c (check_explicit_specialization): Complain about default args
|
||||||
in explicit specialization.
|
in explicit specialization.
|
||||||
|
|
||||||
|
|
13
gcc/cp/pt.c
13
gcc/cp/pt.c
|
@ -1381,11 +1381,6 @@ push_template_decl (decl)
|
||||||
int is_friend = (TREE_CODE (decl) == FUNCTION_DECL
|
int is_friend = (TREE_CODE (decl) == FUNCTION_DECL
|
||||||
&& DECL_FRIEND_P (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)
|
if (is_friend)
|
||||||
/* For a friend, we want the context of the friend function, not
|
/* For a friend, we want the context of the friend function, not
|
||||||
the type of which it is a friend. */
|
the type of which it is a friend. */
|
||||||
|
@ -1416,6 +1411,14 @@ push_template_decl (decl)
|
||||||
else
|
else
|
||||||
primary = 0;
|
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. */
|
/* Partial specialization. */
|
||||||
if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl)
|
if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl)
|
||||||
&& CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl)))
|
&& CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl)))
|
||||||
|
|
Loading…
Reference in New Issue