+2003-01-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/9120
+ * parser.c (cp_parser_scope_through_which_access_occurs): Handle
+ an object_type which is not a class type.
+
2003-01-10 Geoffrey Keating <geoffk@apple.com>
* parser.c (cp_parser_late_parsing_for_member): Don't cast to void.
if (!TYPE_P (scope))
return NULL_TREE;
/* Figure out the type through which DECL is being accessed. */
- if (object_type && DERIVED_FROM_P (scope, object_type))
+ if (object_type
+ /* OBJECT_TYPE might not be a class type; consider:
+
+ class A { typedef int I; };
+ I *p;
+ p->A::I::~I();
+
+ In this case, we will have "A::I" as the DECL, but "I" as the
+ OBJECT_TYPE. */
+ && CLASS_TYPE_P (object_type)
+ && DERIVED_FROM_P (scope, object_type))
/* If we are processing a `->' or `.' expression, use the type of the
left-hand side. */
qualifying_type = object_type;