Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CurrentObject.cc

    r84e8423 r4b97770  
    6262                virtual ~MemberIterator() {}
    6363
    64                 /// walks the current object using the given designators as a guide
    6564                virtual void setPosition( std::list< Expression * > & designators ) = 0;
    66 
    67                 /// retrieve the list of possible Type/Designaton pairs for the current position in the currect object
    6865                virtual std::list<InitAlternative> operator*() const = 0;
    69 
    70                 /// true if the iterator is not currently at the end
    7166                virtual operator bool() const = 0;
    72 
    73                 /// moves the iterator by one member in the current object
    7467                virtual MemberIterator & bigStep() = 0;
    75 
    76                 /// moves the iterator by one member in the current subobject
    7768                virtual MemberIterator & smallStep() = 0;
    78 
    79                 /// the type of the current object
    8069                virtual Type * getType() = 0;
    81 
    82                 /// the type of the current subobject
    8370                virtual Type * getNext() = 0;
    8471
    85                 /// printing for debug
    8672                virtual void print( std::ostream & out, Indenter indent ) const = 0;
    8773
    88                 /// helper for operator*; aggregates must add designator to each init alternative, but
    89                 /// adding designators in operator* creates duplicates.
    9074                virtual std::list<InitAlternative> first() const = 0; // should be protected
    9175        };
     
    370354                                }
    371355                        }
    372                         if ( atbegin ) {
     356                        // if ( curMember == std::next( decl->get_members().begin(), 1 ) ) { // xxx - this never triggers because curMember is incremented immediately on construction
     357                        if ( atbegin ) { // xxx - this never triggers because curMember is incremented immediately on construction
    373358                                // xxx - what about case of empty struct??
    374359                                // only add self if at the very beginning of the structure
     
    404389                        return *this;
    405390                }
     391                virtual std::list<InitAlternative> first() const { return std::list<InitAlternative>{}; }
    406392        };
    407393
     
    457443                                return new UnionIterator( uit );
    458444                        } else {
    459                                 assertf( dynamic_cast< EnumInstType * >( type ) || dynamic_cast< TypeInstType * >( type ), "Encountered unhandled ReferenceToType in createMemberIterator: %s", toString( type ).c_str() );
     445                                assertf( dynamic_cast< TypeInstType * >( type ), "some other reftotype" );
    460446                                return new SimpleIterator( type );
    461447                        }
Note: See TracChangeset for help on using the changeset viewer.