Commit 5b4acce1 by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

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
parent 86d7b562
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> 2004-01-02 Richard Sandiford <rsandifo@redhat.com>
PR target/12729 PR target/12729
......
...@@ -8169,12 +8169,13 @@ cp_parser_template_argument (cp_parser* parser) ...@@ -8169,12 +8169,13 @@ cp_parser_template_argument (cp_parser* parser)
if (!cp_parser_error_occurred (parser)) if (!cp_parser_error_occurred (parser))
{ {
/* Figure out what is being referred to. */ /* Figure out what is being referred to. */
argument = cp_parser_lookup_name_simple (parser, argument); argument = cp_parser_lookup_name (parser, argument,
if (template_p) /*is_type=*/false,
argument = make_unbound_class_template (TREE_OPERAND (argument, 0), /*is_template=*/template_p,
TREE_OPERAND (argument, 1), /*is_namespace=*/false,
tf_error); /*check_dependency=*/true);
else if (TREE_CODE (argument) != TEMPLATE_DECL) if (TREE_CODE (argument) != TEMPLATE_DECL
&& TREE_CODE (argument) != UNBOUND_CLASS_TEMPLATE)
cp_parser_error (parser, "expected template-name"); cp_parser_error (parser, "expected template-name");
} }
if (cp_parser_parse_definitely (parser)) if (cp_parser_parse_definitely (parser))
...@@ -13347,9 +13348,9 @@ cp_parser_lookup_name (cp_parser *parser, tree name, ...@@ -13347,9 +13348,9 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
name, name,
/*complain=*/1)); /*complain=*/1));
else if (is_template) else if (is_template)
decl = TYPE_NAME (make_unbound_class_template (parser->scope, decl = make_unbound_class_template (parser->scope,
name, name,
/*complain=*/1)); /*complain=*/1);
else else
decl = build_nt (SCOPE_REF, parser->scope, name); decl = build_nt (SCOPE_REF, parser->scope, name);
} }
...@@ -13428,6 +13429,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name, ...@@ -13428,6 +13429,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
my_friendly_assert (DECL_P (decl) my_friendly_assert (DECL_P (decl)
|| TREE_CODE (decl) == OVERLOAD || TREE_CODE (decl) == OVERLOAD
|| TREE_CODE (decl) == SCOPE_REF || TREE_CODE (decl) == SCOPE_REF
|| TREE_CODE (decl) == UNBOUND_CLASS_TEMPLATE
|| BASELINK_P (decl), || BASELINK_P (decl),
20000619); 20000619);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment