Ignore:
Timestamp:
Jun 1, 2016, 11:54:23 AM (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, gc_noraii, 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:
be945ac
Parents:
70f89d00
Message:

can construct global const objects, except with intrinsic constructors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    r70f89d00 rf1b1e4c  
    291291
    292292        namespace {
    293                 template< typename DWTIterator >
    294                 void fixFunctionList( DWTIterator begin, DWTIterator end, FunctionType *func ) {
     293                template< typename DWTIterator, typename DWTList >
     294                void fixFunctionList( DWTIterator begin, DWTIterator end, FunctionType *func, DWTList & dwts ) {
    295295                        // the only case in which "void" is valid is where it is the only one in the list; then it should be removed
    296296                        // entirely other fix ups are handled by the FixFunction class
     
    298298                        FixFunction fixer;
    299299                        DWTIterator i = begin;
    300                         *i = (*i )->acceptMutator( fixer );
     300                        *i = (*i)->acceptMutator( fixer );
    301301                        if ( fixer.get_isVoid() ) {
    302302                                DWTIterator j = i;
    303303                                ++i;
    304                                 func->get_parameters().erase( j );
     304                                dwts.erase( j );
    305305                                if ( i != end ) {
    306306                                        throw SemanticError( "invalid type void in function type ", func );
     
    321321        void Pass1::visit( FunctionType *func ) {
    322322                // Fix up parameters and return types
    323                 fixFunctionList( func->get_parameters().begin(), func->get_parameters().end(), func );
    324                 fixFunctionList( func->get_returnVals().begin(), func->get_returnVals().end(), func );
     323                fixFunctionList( func->get_parameters().begin(), func->get_parameters().end(), func, func->get_parameters() );
     324                fixFunctionList( func->get_returnVals().begin(), func->get_returnVals().end(), func, func->get_returnVals() );
    325325                Visitor::visit( func );
    326326        }
Note: See TracChangeset for help on using the changeset viewer.