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
TEMPLATE_ID_EXPRs.
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));
}
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:
}
}
+/* 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 *
&& 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: