aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>2004-01-03 08:25:38 +0000
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>2004-01-03 08:25:38 +0000
commit5b4acce124adcc148231f4200cf655d13cb65112 (patch)
tree5f5b26285a9f3f37c9b1b709da5e00945f4158cd /gcc
parent86d7b5621f2487c9db19469d6af4bda61268099f (diff)
downloadgcc-5b4acce124adcc148231f4200cf655d13cb65112.zip
gcc-5b4acce124adcc148231f4200cf655d13cb65112.tar.gz
gcc-5b4acce124adcc148231f4200cf655d13cb65112.tar.bz2
parser.c (cp_parser_template_argument): Don't call make_unbound_class_template directly.
* parser.c (cp_parser_template_argument): Don't call make_unbound_class_template directly. (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from UNBOUND_CLASS_TEMPLATE tree node. From-SVN: r75356
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/parser.c20
2 files changed, 19 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b2ab218..897f846 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2004-01-03 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/13094
+ * parser.c (cp_parser_template_argument): Don't call
+ make_unbound_class_template directly.
+ (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
+ UNBOUND_CLASS_TEMPLATE tree node.
+
2004-01-02 Richard Sandiford <rsandifo@redhat.com>
PR target/12729
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index f66a0a8..e62288c 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -8169,12 +8169,13 @@ cp_parser_template_argument (cp_parser* parser)
if (!cp_parser_error_occurred (parser))
{
/* Figure out what is being referred to. */
- argument = cp_parser_lookup_name_simple (parser, argument);
- if (template_p)
- argument = make_unbound_class_template (TREE_OPERAND (argument, 0),
- TREE_OPERAND (argument, 1),
- tf_error);
- else if (TREE_CODE (argument) != TEMPLATE_DECL)
+ argument = cp_parser_lookup_name (parser, argument,
+ /*is_type=*/false,
+ /*is_template=*/template_p,
+ /*is_namespace=*/false,
+ /*check_dependency=*/true);
+ if (TREE_CODE (argument) != TEMPLATE_DECL
+ && TREE_CODE (argument) != UNBOUND_CLASS_TEMPLATE)
cp_parser_error (parser, "expected template-name");
}
if (cp_parser_parse_definitely (parser))
@@ -13347,9 +13348,9 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
name,
/*complain=*/1));
else if (is_template)
- decl = TYPE_NAME (make_unbound_class_template (parser->scope,
- name,
- /*complain=*/1));
+ decl = make_unbound_class_template (parser->scope,
+ name,
+ /*complain=*/1);
else
decl = build_nt (SCOPE_REF, parser->scope, name);
}
@@ -13428,6 +13429,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
my_friendly_assert (DECL_P (decl)
|| TREE_CODE (decl) == OVERLOAD
|| TREE_CODE (decl) == SCOPE_REF
+ || TREE_CODE (decl) == UNBOUND_CLASS_TEMPLATE
|| BASELINK_P (decl),
20000619);