Ignore:
Timestamp:
Jan 23, 2017, 11:42:09 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:
092528b
Parents:
bd98b58
Message:

disable autogeneration of ctor/dtor/assign when a member's corresponding operation is missing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cc

    rbd98b58 r207c7e1d  
    547547        }
    548548
     549        FunctionDecl * isAssignment( Declaration * decl ) {
     550                return isCopyFunction( decl, "?=?" );
     551        }
     552        FunctionDecl * isDestructor( Declaration * decl ) {
     553                if ( isDestructor( decl->get_name() ) ) {
     554                        return dynamic_cast< FunctionDecl * >( decl );
     555                }
     556                return nullptr;
     557        }
     558        FunctionDecl * isDefaultConstructor( Declaration * decl ) {
     559                if ( isConstructor( decl->get_name() ) ) {
     560                        if ( FunctionDecl * func = dynamic_cast< FunctionDecl * >( decl ) ) {
     561                                if ( func->get_functionType()->get_parameters().size() == 1 ) {
     562                                        return func;
     563                                }
     564                        }
     565                }
     566                return nullptr;
     567        }
    549568        FunctionDecl * isCopyConstructor( Declaration * decl ) {
    550569                return isCopyFunction( decl, "?{}" );
Note: See TracChangeset for help on using the changeset viewer.