Commit cf776105 by Jason Merrill Committed by Jason Merrill

decl.c: Lose arg_looking_for_template.

	* decl.c: Lose arg_looking_for_template.
	(lookup_name_real): Likewise.
	* parse.y: Lose processing_template_arg, template_arg1
	(primary): Likewise.
	* spew.c (yylex): Set lastiddecl for PTYPENAMEs, too.

From-SVN: r17651
parent e7e66632
Tue Feb 3 22:43:42 1998 Jason Merrill <jason@yorick.cygnus.com>
* decl.c: Lose arg_looking_for_template.
(lookup_name_real): Likewise.
* parse.y: Lose processing_template_arg, template_arg1
(primary): Likewise.
* spew.c (yylex): Set lastiddecl for PTYPENAMEs, too.
Tue Feb 3 22:04:01 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
* error.c (dump_decl): Fix type of default arguments for template
......
......@@ -396,9 +396,6 @@ static struct named_label_list *named_label_uses = NULL;
in the TREE_PURPOSE slot. */
tree static_aggregates;
/* Nonzero if we lookup name inside template argument. */
int arg_looking_for_template;
/* -- end of C++ */
/* Two expressions that are constants with value zero.
......@@ -4679,13 +4676,7 @@ lookup_name_real (name, prefer_type, nonclass)
val = from_obj;
}
if (TREE_CODE (val) == TEMPLATE_DECL && arg_looking_for_template)
{
/* TEMPLATE_TEMPLATE_PARM node is preferred over TEMPLATE_DECL. */
if (DECL_TEMPLATE_TEMPLATE_PARM_P (val))
val = TREE_TYPE (val);
}
else if ((TREE_CODE (val) == TEMPLATE_DECL && looking_for_template)
if ((TREE_CODE (val) == TEMPLATE_DECL && looking_for_template)
|| TREE_CODE (val) == TYPE_DECL || prefer_type <= 0)
;
else if (IDENTIFIER_HAS_TYPE_VALUE (name))
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -71,12 +71,6 @@ extern tree strip_attrs PROTO((tree));
error message if the user supplies an empty conditional expression. */
static char *cond_stmt_keyword;
/* If nonzero, we try to treat TEMPLATE_DECL as argument in template
template parameter. */
static int processing_template_arg;
extern int arg_looking_for_template;
static tree empty_parms PROTO((void));
/* Nonzero if we have an `extern "C"' acting as an extern specifier. */
......@@ -267,7 +261,7 @@ empty_parms ()
%type <ttype> template_type_parm template_template_parm
%type <code> template_close_bracket
%type <ttype> template_type template_arg_list template_arg_list_opt
%type <ttype> template_arg template_arg1
%type <ttype> template_arg
%type <ttype> condition xcond paren_cond_or_null
%type <ttype> type_name nested_name_specifier nested_type ptr_to_mem
%type <ttype> complete_type_name notype_identifier nonnested_type
......@@ -958,12 +952,6 @@ template_arg_list:
;
template_arg:
{ processing_template_arg = 1; }
template_arg1
{ $$ = $2;
processing_template_arg = 0; }
template_arg1:
type_id
{ $$ = groktypename ($1.t); }
| expr_no_commas %prec ARITHCOMPARE
......@@ -1379,23 +1367,7 @@ primary:
if (TREE_CODE ($$) == BIT_NOT_EXPR)
$$ = build_x_unary_op (BIT_NOT_EXPR, TREE_OPERAND ($$, 0));
else if (TREE_CODE ($$) != TEMPLATE_ID_EXPR)
{
if (processing_template_arg)
{
tree id;
arg_looking_for_template = processing_template_arg;
id = lookup_name ($$, 0);
arg_looking_for_template = 0;
if (!id || id == error_mark_node
|| (TREE_CODE (id) != TEMPLATE_DECL
&& TREE_CODE (id) != TEMPLATE_TEMPLATE_PARM))
id = do_identifier ($$, 1);
$$ = id;
}
else
$$ = do_identifier ($$, 1);
}
$$ = do_identifier ($$, 1);
}
| CONSTANT
| boolean.literal
......
......@@ -312,22 +312,18 @@ yylex ()
{
case TYPENAME:
case SELFNAME:
case NSNAME:
lastiddecl = trrr;
if (got_scope)
tmp_token.yylval.ttype = trrr;
break;
case PFUNCNAME:
case IDENTIFIER:
lastiddecl = trrr;
break;
case PTYPENAME:
lastiddecl = NULL_TREE;
break;
case NSNAME:
lastiddecl = trrr;
if (got_scope)
tmp_token.yylval.ttype = trrr;
break;
default:
my_friendly_abort (101);
}
......
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