+2000-06-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * parse.y (do_resolve_class): Minor optimiztion in the package
+ list search. Removed unecessary test and return statement.
+ (valid_ref_assignconv_cast_p): Order of arguments to
+ enclosing_context_p fixed.
+
2000-06-24 Tom Tromey <tromey@cygnus.com>
* expr.c (lookup_field): Print error and return error_mark_node if
if (!QUALIFIED_P (TYPE_NAME (class_type)))
{
tree package;
- for (package = package_list; package; package = TREE_CHAIN (package))
+
+ /* If there is a current package (ctxp->package), it's the first
+ element of package_list and we can skip it. */
+ for (package = (ctxp->package ?
+ TREE_CHAIN (package_list) : package_list);
+ package; package = TREE_CHAIN (package))
if ((new_class_decl = qualify_and_find (class_type,
TREE_PURPOSE (package),
TYPE_NAME (class_type))))
(cl ? cl : lookup_cl (decl))))
return NULL_TREE;
- if ((new_class_decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type))))
- return new_class_decl;
-
/* 6- Last call for a resolution */
return IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type));
}
if (TYPE_CLASS_P (dest))
return (source == dest
|| inherits_from_p (source, dest)
- || enclosing_context_p (dest, source /*source, dest*/)
+ || enclosing_context_p (source, dest)
|| (cast && inherits_from_p (dest, source)));
if (TYPE_INTERFACE_P (dest))
{
if (!QUALIFIED_P (TYPE_NAME (class_type)))
{
tree package;
- for (package = package_list; package; package = TREE_CHAIN (package))
+
+ /* If there is a current package (ctxp->package), it's the first
+ element of package_list and we can skip it. */
+ for (package = (ctxp->package ?
+ TREE_CHAIN (package_list) : package_list);
+ package; package = TREE_CHAIN (package))
if ((new_class_decl = qualify_and_find (class_type,
TREE_PURPOSE (package),
TYPE_NAME (class_type))))
(cl ? cl : lookup_cl (decl))))
return NULL_TREE;
- if ((new_class_decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type))))
- return new_class_decl;
-
/* 6- Last call for a resolution */
return IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type));
}
if (TYPE_CLASS_P (dest))
return (source == dest
|| inherits_from_p (source, dest)
- || enclosing_context_p (dest, source /*source, dest*/)
+ || enclosing_context_p (source, dest)
|| (cast && inherits_from_p (dest, source)));
if (TYPE_INTERFACE_P (dest))
{