Ignore:
Timestamp:
Sep 22, 2017, 5:46:04 PM (6 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:
aec3e6b
Parents:
22bc276
git-author:
Rob Schluntz <rschlunt@…> (09/22/17 17:45:24)
git-committer:
Rob Schluntz <rschlunt@…> (09/22/17 17:46:04)
Message:

Add isConstructable helper to InitTweak?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cc

    r22bc276 r29bc63e  
    2222#include "SynTree/Type.h"          // for FunctionType, ArrayType, PointerType
    2323#include "SynTree/Visitor.h"       // for Visitor, maybeAccept
     24#include "Tuples/Tuples.h"         // for Tuples::isTtype
    2425
    2526class UntypedValofExpr;
     
    276277                                ( objDecl->get_init() != nullptr && objDecl->get_init()->get_maybeConstructed() ))
    277278                        && ! objDecl->get_storageClasses().is_extern
    278                         && ! dynamic_cast< ReferenceType * >( objDecl->type );
     279                        && isConstructable( objDecl->type );
     280        }
     281
     282        bool isConstructable( Type * type ) {
     283                return ! dynamic_cast< VarArgsType * >( type ) && ! dynamic_cast< ReferenceType * >( type ) && ! dynamic_cast< FunctionType * >( type ) && ! Tuples::isTtype( type );
    279284        }
    280285
Note: See TracChangeset for help on using the changeset viewer.