aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@gcc.gnu.org>1998-08-29 01:15:22 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>1998-08-29 01:15:22 +0000
commit6091762575f61a6fd42f3e987498181675930a58 (patch)
tree917c04a1f9fd0eaa788e730ed2d07ee5a7930308
parentd84f48212d7c6cc7275cd68768b54e3a342a0cfb (diff)
downloadgcc-6091762575f61a6fd42f3e987498181675930a58.zip
gcc-6091762575f61a6fd42f3e987498181675930a58.tar.gz
gcc-6091762575f61a6fd42f3e987498181675930a58.tar.bz2
pt.c (decl_template_parm_p): Add checks for TEMPLATE_TEMPLATE_PARM.
� 1998-08-28 Benjamin Kosnik <bkoz@loony.cygnus.com> * pt.c (decl_template_parm_p): Add checks for TEMPLATE_TEMPLATE_PARM. From-SVN: r22071
-rw-r--r--gcc/cp/pt.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index d86eea8..364fd52 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1458,16 +1458,25 @@ int comp_template_parms (parms1, parms2)
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)))
+ /* For template template parms. */
+ if (TREE_CODE (old_decl) == TEMPLATE_DECL
+ && TREE_TYPE (old_decl)
+ && TREE_CODE (TREE_TYPE (old_decl)) == TEMPLATE_TEMPLATE_PARM)
return 1;
- else
- return 0;
+
+ /* For template type parms. */
+ if (TREE_CODE (old_decl) == TYPE_DECL
+ && TREE_TYPE (old_decl)
+ && TREE_CODE (TREE_TYPE (old_decl)) == TEMPLATE_TYPE_PARM)
+ return 1;
+
+ /* For template non-type parms. */
+ if (TREE_CODE (old_decl) == CONST_DECL
+ && DECL_INITIAL (old_decl)
+ && TREE_CODE (DECL_INITIAL (old_decl)) == TEMPLATE_PARM_INDEX)
+ return 1;
+
+ return 0;
}