Changeset 0b4d93ab for src


Ignore:
Timestamp:
Jul 8, 2016, 6:10:47 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
07bc165, cad355a
Parents:
540b275
Message:

fix bug where field constructors would generate calls to constructors for anonymous members and unnamed bitfields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    r540b275 r0b4d93ab  
    289289                for ( ; member != end; ++member ) {
    290290                        if ( DeclarationWithType * field = dynamic_cast<DeclarationWithType*>( *member ) ) {
    291                                 if ( parameter != params.end() ) {
     291                                if ( isUnnamedBitfield( dynamic_cast< ObjectDecl * > ( field ) ) ) {
     292                                        // don't make a function whose parameter is an unnamed bitfield
     293                                        continue;
     294                                } else if ( field->get_name() == "" ) {
     295                                        // don't assign to anonymous members
     296                                        // xxx - this is a temporary fix. Anonymous members tie into
     297                                        // our inheritance model. I think the correct way to handle this is to
     298                                        // cast the structure to the type of the member and let the resolver
     299                                        // figure out whether it's valid and have a pass afterwards that fixes
     300                                        // the assignment to use pointer arithmetic with the offset of the
     301                                        // member, much like how generic type members are handled.
     302                                        continue;
     303                                } else if ( parameter != params.end() ) {
    292304                                        // matching parameter, initialize field with copy ctor
    293305                                        Expression *srcselect = new VariableExpr(*parameter);
Note: See TracChangeset for help on using the changeset viewer.