Changeset 084fecc for src


Ignore:
Timestamp:
Jul 12, 2017, 4:48:35 PM (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:
a61ad31
Parents:
cda7889
Message:

Update error handling for first parameter to ctor/dtor/assign

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    rcda7889 r084fecc  
    823823                                throw SemanticError( "Constructors, destructors, and assignment functions require at least one parameter ", funcDecl );
    824824                        }
    825                         PointerType * ptrType = dynamic_cast< PointerType * >( params.front()->get_type() );
    826825                        ReferenceType * refType = dynamic_cast< ReferenceType * >( params.front()->get_type() );
    827                         if ( ( ! ptrType && ! refType ) || ( ptrType && ptrType->is_array() ) ) {
    828                                 throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a pointer ", funcDecl );
     826                        if ( ! refType ) {
     827                                throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a reference ", funcDecl );
    829828                        }
    830829                        if ( InitTweak::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) {
Note: See TracChangeset for help on using the changeset viewer.