/* Breadth-first and depth-first routines for
searching multiple-inheritance lattice for GNU C++.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2002, 2003, 2004, 2005, 2007, 2008, 2009
+ 1999, 2000, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
public typedef created in the scope of every class. */
decl = TYPE_FIELDS (base);
while (!DECL_SELF_REFERENCE_P (decl))
- decl = TREE_CHAIN (decl);
+ decl = DECL_CHAIN (decl);
while (ANON_AGGR_TYPE_P (t))
t = TYPE_CONTEXT (t);
return accessible_p (t, decl, consider_local_p);
#ifdef GATHER_STATISTICS
n_calls_lookup_field_1++;
#endif /* GATHER_STATISTICS */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
#ifdef GATHER_STATISTICS
n_fields_searched++;
if (CLASS_TYPE_P (base_return) && CLASS_TYPE_P (over_return))
{
- tree binfo = lookup_base (over_return, base_return,
- ba_check | ba_quiet, NULL);
+ /* Strictly speaking, the standard requires the return type to be
+ complete even if it only differs in cv-quals, but that seems
+ like a bug in the wording. */
+ if (!same_type_ignoring_top_level_qualifiers_p (base_return, over_return))
+ {
+ tree binfo = lookup_base (over_return, base_return,
+ ba_check | ba_quiet, NULL);
- if (!binfo)
- fail = 1;
+ if (!binfo)
+ fail = 1;
+ }
}
else if (!pedantic
&& can_convert (TREE_TYPE (base_type), TREE_TYPE (over_type)))
int ix;
int found = 0;
+ /* A constructor for a class T does not override a function T
+ in a base class. */
+ if (DECL_CONSTRUCTOR_P (fndecl))
+ return 0;
+
for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ix++)
{
tree basetype = BINFO_TYPE (base_binfo);
functions in this node were selected. This function is effectively
performing a set of member lookups as lookup_fnfield does, but
using the type being converted to as the unique key, rather than the
- field name.
- If LOOKUP_TEMPLATE_CONVS_P is TRUE, the returned TREE_LIST contains
- the non-hidden user-defined template conversion functions too. */
+ field name. */
tree
-lookup_conversions (tree type,
- bool lookup_template_convs_p)
+lookup_conversions (tree type)
{
tree convs, tpl_convs;
tree list = NULL_TREE;
}
}
- if (lookup_template_convs_p == false)
- tpl_convs = NULL_TREE;
-
for (; tpl_convs; tpl_convs = TREE_CHAIN (tpl_convs))
{
tree probe, next;