summaryrefslogtreecommitdiff
path: root/gcc/cp/parse.y
diff options
context:
space:
mode:
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>2001-10-23 09:14:15 +0000
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>2001-10-23 09:14:15 +0000
commitb8c6534b88ee39ff0e92ba90d3e606a894e14f8d (patch)
treee337f303c7c3e814a36bdbf76e6e8b021e47b1c1 /gcc/cp/parse.y
parent69f75f9daa41e53683e8ba8e2b87666620a7226b (diff)
downloadgcc-b8c6534b88ee39ff0e92ba90d3e606a894e14f8d.tar.gz
cp-tree.def (UNBOUND_CLASS_TEMPLATE): New tree node.
* cp-tree.def (UNBOUND_CLASS_TEMPLATE): New tree node. * cp-tree.h (make_unbound_class_template): Prototype new function. * decl.c (make_unbound_class_template): New function. * decl2.c (arg_assoc_template_arg): Handle UNBOUND_CLASS_TEMPLATE. * error.c (dump_type): Likewise. * mangle.c (write_type): Likewise. * parse.y (template_parm): Likewise. (template_argument): Use make_unbound_class_template. * pt.c (convert_template_argument): Handle UNBOUND_CLASS_TEMPLATE. (tsubst): Likewise. (tsubst_copy): Likewise. (unify): Likewise. * tree.c (walk_tree): Likewise. * typeck.c (comptypes): Likewise. From-SVN: r46430
Diffstat (limited to 'gcc/cp/parse.y')
-rw-r--r--gcc/cp/parse.y13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index f3e85ffe849..937e1c8e817 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -669,7 +669,8 @@ template_parm:
{
if (TREE_CODE ($3) != TEMPLATE_DECL
&& TREE_CODE ($3) != TEMPLATE_TEMPLATE_PARM
- && TREE_CODE ($3) != TYPE_DECL)
+ && TREE_CODE ($3) != TYPE_DECL
+ && TREE_CODE ($3) != UNBOUND_CLASS_TEMPLATE)
{
error ("invalid default template argument");
$3 = error_mark_node;
@@ -1100,6 +1101,16 @@ template_arg:
$$ = TREE_TYPE ($$);
}
| expr_no_comma_rangle
+ | nested_name_specifier TEMPLATE identifier
+ {
+ if (!processing_template_decl)
+ {
+ cp_error ("use of template qualifier outside template");
+ $$ = error_mark_node;
+ }
+ else
+ $$ = make_unbound_class_template ($1, $3, 1);
+ }
;
unop: