error.c (dump_typename): New function, broken out of ...
* error.c (dump_typename): New function, broken out of ... (dump_type): ... here. Use it. * typeck.c (same_type_p): Use cp_tree_equal for TYPENAME_TYPE. From-SVN: r36193
This commit is contained in:
parent
630c79be17
commit
46e2747c71
3 changed files with 29 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
|||
2000-09-06 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* error.c (dump_typename): New function, broken out of ...
|
||||
(dump_type): ... here. Use it.
|
||||
* typeck.c (same_type_p): Use cp_tree_equal for TYPENAME_TYPE.
|
||||
|
||||
2000-09-06 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* init.c (build_offset_ref): Deal with namespace scoped
|
||||
|
|
|
@ -87,6 +87,7 @@ static const char *parm_to_string PARAMS ((int, int));
|
|||
static const char *type_to_string PARAMS ((tree, int));
|
||||
|
||||
static void dump_type PARAMS ((tree, enum tree_string_flags));
|
||||
static void dump_typename PARAMS ((tree, enum tree_string_flags));
|
||||
static void dump_simple_decl PARAMS ((tree, tree, enum tree_string_flags));
|
||||
static void dump_decl PARAMS ((tree, enum tree_string_flags));
|
||||
static void dump_template_decl PARAMS ((tree, enum tree_string_flags));
|
||||
|
@ -503,9 +504,7 @@ dump_type (t, flags)
|
|||
}
|
||||
case TYPENAME_TYPE:
|
||||
OB_PUTS ("typename ");
|
||||
dump_type (TYPE_CONTEXT (t), flags & ~TS_AGGR_TAGS);
|
||||
OB_PUTS ("::");
|
||||
dump_decl (TYPENAME_TYPE_FULLNAME (t), flags);
|
||||
dump_typename (t, flags);
|
||||
break;
|
||||
|
||||
case TYPEOF_TYPE:
|
||||
|
@ -525,6 +524,24 @@ dump_type (t, flags)
|
|||
}
|
||||
}
|
||||
|
||||
/* Dump a TYPENAME_TYPE. We need to notice when the context is itself
|
||||
a TYPENAME_TYPE. */
|
||||
|
||||
static void
|
||||
dump_typename (t, flags)
|
||||
tree t;
|
||||
enum tree_string_flags flags;
|
||||
{
|
||||
tree ctx = TYPE_CONTEXT (t);
|
||||
|
||||
if (TREE_CODE (ctx) == TYPENAME_TYPE)
|
||||
dump_typename (ctx, flags);
|
||||
else
|
||||
dump_type (ctx, flags & ~TS_AGGR_TAGS);
|
||||
OB_PUTS ("::");
|
||||
dump_decl (TYPENAME_TYPE_FULLNAME (t), flags);
|
||||
}
|
||||
|
||||
/* Return the name of the supplied aggregate, or enumeral type. */
|
||||
|
||||
static const char *
|
||||
|
|
|
@ -1096,8 +1096,9 @@ comptypes (t1, t2, strict)
|
|||
&& TEMPLATE_TYPE_LEVEL (t1) == TEMPLATE_TYPE_LEVEL (t2);
|
||||
|
||||
case TYPENAME_TYPE:
|
||||
if (TYPE_IDENTIFIER (t1) != TYPE_IDENTIFIER (t2))
|
||||
return 0;
|
||||
if (cp_tree_equal (TYPENAME_TYPE_FULLNAME (t1),
|
||||
TYPENAME_TYPE_FULLNAME (t2)) < 1)
|
||||
return 0;
|
||||
return same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2));
|
||||
|
||||
case COMPLEX_TYPE:
|
||||
|
|
Loading…
Add table
Reference in a new issue