cp-tree.h: Declare.
h 1998-08-24 Benjamin Kosnik <bkoz@cygnus.com> * cp-tree.h: Declare. * pt.c (decl_template_parm_p): New function. * decl.c (pushdecl): Check decls for redeclaring template parms. (xref_tag): Make redeclaration an error, print decl. * decl2.c (grokfield): Check field_decls for redeclaration as well. From-SVN: r21942
This commit is contained in:
parent
037155f1fd
commit
22a7be5365
22
gcc/cp/pt.c
22
gcc/cp/pt.c
|
@ -1451,7 +1451,27 @@ int comp_template_parms (parms1, parms2)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* Return a new TEMPLATE_PARM_INDEX with the indicated INDEX, LEVEL,
|
||||
|
||||
/* Returns 1 iff old_id is a template parameter. OLD_DECL is the decl
|
||||
from IDENTIFIER_LOCAL_VALUE (new identifier). */
|
||||
|
||||
int decl_template_parm_p (old_decl)
|
||||
tree old_decl;
|
||||
{
|
||||
if (TREE_CODE_CLASS (TREE_CODE (old_decl)) == 'd'
|
||||
/* For template type parameters. */
|
||||
&& ((TREE_TYPE (old_decl)
|
||||
&& TREE_CODE (TREE_TYPE (old_decl)) == TEMPLATE_TYPE_PARM)
|
||||
/* For non-type template parameters. */
|
||||
|| (DECL_INITIAL (old_decl)
|
||||
&& TREE_CODE (DECL_INITIAL (old_decl)) == TEMPLATE_PARM_INDEX)))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Return a new TEMPLATE_PARM_INDEX with the indicated INDEX, LEVEL,
|
||||
ORIG_LEVEL, DECL, and TYPE. */
|
||||
|
||||
static tree
|
||||
|
|
Loading…
Reference in New Issue