+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 10:39:27 1997 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (make_implicit_typename): New fn.
&& DECL_CONTEXT (t) != context)
{
tree binfo = get_binfo (DECL_CONTEXT (t), context, 0);
- for (;;)
+ while (binfo)
{
tree next = BINFO_INHERITANCE_CHAIN (binfo);
if (! uses_template_parms (BINFO_TYPE (next))
break;
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
retval = make_typename_type (context, DECL_NAME (t));
{
if (TREE_CODE ($1) == IDENTIFIER_NODE)
{
+ $$ = lookup_name ($1, 1);
if (current_class_type
&& TYPE_BEING_DEFINED (current_class_type)
&& ! 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
definition, as per [class.scope0] */
pushdecl_class_level ($$);
}
- else
- $$ = identifier_typedecl_value ($1);
}
else
$$ = $1;
| global_scope type_name
{
if (TREE_CODE ($2) == IDENTIFIER_NODE)
- $$ = identifier_typedecl_value ($2);
+ $$ = IDENTIFIER_GLOBAL_VALUE ($2);
else
$$ = $2;
got_scope = NULL_TREE;
global_scope type_name
{
if (TREE_CODE ($2) == IDENTIFIER_NODE)
- $$ = identifier_typedecl_value ($2);
+ $$ = IDENTIFIER_GLOBAL_VALUE ($2);
else
$$ = $2;
got_scope = NULL_TREE;
{
case TYPENAME:
case SELFNAME:
- lastiddecl = identifier_typedecl_value (tmp_token.yylval.ttype);
- if (lastiddecl != trrr)
- lastiddecl = trrr;
+ lastiddecl = trrr;
if (got_scope)
tmp_token.yylval.ttype = trrr;
break;
get_type_decl (t)
tree t;
{
- if (TREE_CODE (t) == IDENTIFIER_NODE)
- return identifier_typedecl_value (t);
if (TREE_CODE (t) == TYPE_DECL)
return t;
if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')