Ignore:
Timestamp:
May 2, 2017, 7:09:44 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
9042795
Parents:
2055098
Message:

constructor taking an array parameter is now an error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    r2055098 red8a0d2  
    240240                ReturnTypeFixer::fix( translationUnit ); // must happen before autogen
    241241                acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions
     242                acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist
     243                VerifyCtorDtorAssign::verify( translationUnit );  // must happen before autogen, because autogen examines existing ctor/dtors
    242244                Concurrency::applyKeywords( translationUnit );
    243245                autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecayPass
    244246                Concurrency::implementMutexFuncs( translationUnit );
    245247                Concurrency::implementThreadStarter( translationUnit );
    246                 acceptAll( translationUnit, epc );
    247248                ReturnChecker::checkFunctionReturns( translationUnit );
    248249                compoundliteral.mutateDeclarationList( translationUnit );
    249250                acceptAll( translationUnit, pass3 );
    250                 VerifyCtorDtorAssign::verify( translationUnit );
    251251                ArrayLength::computeLength( translationUnit );
    252252        }
     
    817817                                throw SemanticError( "Constructors, destructors, and assignment functions require at least one parameter ", funcDecl );
    818818                        }
    819                         if ( ! dynamic_cast< PointerType * >( params.front()->get_type() ) ) {
     819                        PointerType * ptrType = dynamic_cast< PointerType * >( params.front()->get_type() );
     820                        if ( ! ptrType || ptrType->is_array() ) {
    820821                                throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a pointer ", funcDecl );
    821822                        }
Note: See TracChangeset for help on using the changeset viewer.