Changeset 4d3ca1d8 for src/SymTab


Ignore:
Timestamp:
Jun 27, 2016, 3:43:10 PM (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:
888cbe4
Parents:
f1ee72e (diff), c1c09285 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ctor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    rf1ee72e r4d3ca1d8  
    483483
    484484        void ReturnChecker::visit( ReturnStmt * returnStmt ) {
     485                // Previously this also checked for the existence of an expr paired with no return values on
     486                // the  function return type. This is incorrect, since you can have an expression attached to
     487                // a return statement in a void-returning function in C. The expression is treated as if it
     488                // were cast to void.
    485489                if ( returnStmt->get_expr() == NULL && returnVals.size() != 0 ) {
    486490                        throw SemanticError( "Non-void function returns no values: " , returnStmt );
    487                 } else if ( returnStmt->get_expr() != NULL && returnVals.size() == 0 ) {
    488                         throw SemanticError( "void function returns values: " , returnStmt );
    489491                }
    490492        }
Note: See TracChangeset for help on using the changeset viewer.