Ignore:
Timestamp:
Oct 19, 2017, 11:15:35 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
ab4bff5
Parents:
447c356
git-author:
Rob Schluntz <rschlunt@…> (10/17/17 10:26:33)
git-committer:
Rob Schluntz <rschlunt@…> (10/19/17 11:15:35)
Message:

Skip non-constructable types during autogen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    r447c356 r6fc5c14  
    379379                                // don't make a function whose parameter is an unnamed bitfield
    380380                                continue;
     381                        } else if ( ! InitTweak::isConstructable( field->get_type() ) ) {
     382                                continue;
    381383                        }
    382384                        memCtorType->parameters.push_back( new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, 0, field->get_type()->clone(), 0 ) );
     
    407409                                }
    408410
    409                                 if ( type->get_const() && func->get_name() == "?=?" ) {
     411                                if ( type->get_const() && CodeGen::isAssignment( func->name ) ) {
    410412                                        // don't assign const members, but do construct/destruct
     413                                        continue;
     414                                } else if ( CodeGen::isCtorDtor( func->name ) && ! InitTweak::isConstructable( type ) ) {
     415                                        // don't construct non-constructable types
    411416                                        continue;
    412417                                }
     
    441446                                if ( isUnnamedBitfield( dynamic_cast< ObjectDecl * > ( field ) ) ) {
    442447                                        // don't make a function whose parameter is an unnamed bitfield
     448                                        continue;
     449                                } else if ( ! InitTweak::isConstructable( field->get_type() ) ) {
     450                                        // don't construct non-constructable types
    443451                                        continue;
    444452                                } else if ( parameter != params.end() ) {
Note: See TracChangeset for help on using the changeset viewer.