Commit 5951f637 by Jason Merrill

decl.c (make_implicit_typename): Handle case where t is not actually from context.

	* decl.c (make_implicit_typename): Handle case where t is not
 	actually from context.
	* tree.c (get_type_decl): Lose identifier case.
	* spew.c (yylex): Lose useless call to identifer_typedecl_value.
	* parse.y (nonnested_type): Just use lookup_name.
	(complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE.

Wed Nov 19 11:45:07 1997  Michael Tiemann  <tiemann@axon.cygnus.com>

	* error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case
	T was built in C language context (for example, by
	output_func_start_profiler).

From-SVN: r16589
parent 77643ab8
Wed Nov 19 18:24:14 1997 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (make_implicit_typename): Handle case where t is not
actually from context.
* tree.c (get_type_decl): Lose identifier case.
* spew.c (yylex): Lose useless call to identifer_typedecl_value.
* parse.y (nonnested_type): Just use lookup_name.
(complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE.
Wed Nov 19 11:45:07 1997 Michael Tiemann <tiemann@axon.cygnus.com>
* error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case
T was built in C language context (for example, by
output_func_start_profiler).
Wed Nov 19 10:39:27 1997 Jason Merrill <jason@yorick.cygnus.com> Wed Nov 19 10:39:27 1997 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (make_implicit_typename): New fn. * decl.c (make_implicit_typename): New fn.
......
...@@ -4389,7 +4389,7 @@ make_implicit_typename (context, t) ...@@ -4389,7 +4389,7 @@ make_implicit_typename (context, t)
&& DECL_CONTEXT (t) != context) && DECL_CONTEXT (t) != context)
{ {
tree binfo = get_binfo (DECL_CONTEXT (t), context, 0); tree binfo = get_binfo (DECL_CONTEXT (t), context, 0);
for (;;) while (binfo)
{ {
tree next = BINFO_INHERITANCE_CHAIN (binfo); tree next = BINFO_INHERITANCE_CHAIN (binfo);
if (! uses_template_parms (BINFO_TYPE (next)) if (! uses_template_parms (BINFO_TYPE (next))
...@@ -4397,7 +4397,11 @@ make_implicit_typename (context, t) ...@@ -4397,7 +4397,11 @@ make_implicit_typename (context, t)
break; break;
binfo = next; binfo = next;
} }
retval = make_typename_type (BINFO_TYPE (binfo), DECL_NAME (t)); if (binfo)
retval = make_typename_type (BINFO_TYPE (binfo), DECL_NAME (t));
else
/* FIXME: find the enclosing class whose base t comes from. */
retval = make_typename_type (DECL_CONTEXT (t), DECL_NAME (t));
} }
else else
retval = make_typename_type (context, DECL_NAME (t)); retval = make_typename_type (context, DECL_NAME (t));
......
...@@ -925,7 +925,8 @@ dump_function_name (t) ...@@ -925,7 +925,8 @@ dump_function_name (t)
else else
dump_decl (name, 0); dump_decl (name, 0);
if ((DECL_TEMPLATE_SPECIALIZATION (t) || DECL_IMPLICIT_INSTANTIATION (t)) if (DECL_LANG_SPECIFIC (t)
&& (DECL_TEMPLATE_SPECIALIZATION (t) || DECL_IMPLICIT_INSTANTIATION (t))
&& (DECL_CLASS_CONTEXT (t) == NULL_TREE || is_member_template (t))) && (DECL_CLASS_CONTEXT (t) == NULL_TREE || is_member_template (t)))
{ {
tree args = DECL_TEMPLATE_INFO (t) tree args = DECL_TEMPLATE_INFO (t)
......
...@@ -3017,18 +3017,15 @@ nonnested_type: ...@@ -3017,18 +3017,15 @@ nonnested_type:
{ {
if (TREE_CODE ($1) == IDENTIFIER_NODE) if (TREE_CODE ($1) == IDENTIFIER_NODE)
{ {
$$ = lookup_name ($1, 1);
if (current_class_type if (current_class_type
&& TYPE_BEING_DEFINED (current_class_type) && TYPE_BEING_DEFINED (current_class_type)
&& ! IDENTIFIER_CLASS_VALUE ($1)) && ! IDENTIFIER_CLASS_VALUE ($1))
{ {
/* Be sure to get an inherited typedef. */
$$ = lookup_name ($1, 1);
/* Remember that this name has been used in the class /* Remember that this name has been used in the class
definition, as per [class.scope0] */ definition, as per [class.scope0] */
pushdecl_class_level ($$); pushdecl_class_level ($$);
} }
else
$$ = identifier_typedecl_value ($1);
} }
else else
$$ = $1; $$ = $1;
...@@ -3036,7 +3033,7 @@ nonnested_type: ...@@ -3036,7 +3033,7 @@ nonnested_type:
| global_scope type_name | global_scope type_name
{ {
if (TREE_CODE ($2) == IDENTIFIER_NODE) if (TREE_CODE ($2) == IDENTIFIER_NODE)
$$ = identifier_typedecl_value ($2); $$ = IDENTIFIER_GLOBAL_VALUE ($2);
else else
$$ = $2; $$ = $2;
got_scope = NULL_TREE; got_scope = NULL_TREE;
...@@ -3285,7 +3282,7 @@ complex_type_name: ...@@ -3285,7 +3282,7 @@ complex_type_name:
global_scope type_name global_scope type_name
{ {
if (TREE_CODE ($2) == IDENTIFIER_NODE) if (TREE_CODE ($2) == IDENTIFIER_NODE)
$$ = identifier_typedecl_value ($2); $$ = IDENTIFIER_GLOBAL_VALUE ($2);
else else
$$ = $2; $$ = $2;
got_scope = NULL_TREE; got_scope = NULL_TREE;
......
...@@ -312,9 +312,7 @@ yylex () ...@@ -312,9 +312,7 @@ yylex ()
{ {
case TYPENAME: case TYPENAME:
case SELFNAME: case SELFNAME:
lastiddecl = identifier_typedecl_value (tmp_token.yylval.ttype); lastiddecl = trrr;
if (lastiddecl != trrr)
lastiddecl = trrr;
if (got_scope) if (got_scope)
tmp_token.yylval.ttype = trrr; tmp_token.yylval.ttype = trrr;
break; break;
......
...@@ -1866,8 +1866,6 @@ tree ...@@ -1866,8 +1866,6 @@ tree
get_type_decl (t) get_type_decl (t)
tree t; tree t;
{ {
if (TREE_CODE (t) == IDENTIFIER_NODE)
return identifier_typedecl_value (t);
if (TREE_CODE (t) == TYPE_DECL) if (TREE_CODE (t) == TYPE_DECL)
return t; return t;
if (TREE_CODE_CLASS (TREE_CODE (t)) == 't') if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
......
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