# HG changeset patch # User John W. Eaton # Date 1295718918 18000 # Node ID 3229572cbe233283b82b235d2cc3db9b55ce072f # Parent 80fc70a534003ed20de97635baecaa806ff083a0 symbol_table::parent_classes: also add parents of parents to the list diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-01-22 John W. Eaton + + * symtab.h (symbol_table::parent_classes): + Also add parents of parents to the list. Bug #32210. + 2011-01-22 Jaroslav Hajek * ov-class.cc (octave_class::subsasgn): Find appropriate unique base diff --git a/src/symtab.h b/src/symtab.h --- a/src/symtab.h +++ b/src/symtab.h @@ -1866,6 +1866,19 @@ if (it != parent_map.end ()) retval = it->second; + for (std::list::const_iterator lit = retval.begin (); + lit != retval.end (); lit++) + { + // Search for parents of parents and append them to the list. + + // FIXME -- should we worry about a circular inheritance graph? + + std::list parents = parent_classes (*lit); + + if (! parents.empty ()) + retval.insert (retval.end (), parents.begin (), parents.end ()); + } + return retval; }