Changeset ea23d10 for src/ResolvExpr


Ignore:
Timestamp:
Feb 8, 2017, 2:35:08 PM (9 years ago)
Author:
Aaron Moss <a3moss@…>
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:
e994912, f923b5f
Parents:
424931d (diff), 4fbdd1e3 (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r424931d rea23d10  
    403403                        // End of actuals - Handle default values
    404404                        if ( SingleInit *si = dynamic_cast<SingleInit *>( defaultValue )) {
    405                                 // so far, only constant expressions are accepted as default values
    406                                 if ( ConstantExpr *cnstexpr = dynamic_cast<ConstantExpr *>( si->get_value()) ) {
    407                                         if ( Constant *cnst = dynamic_cast<Constant *>( cnstexpr->get_constant() ) ) {
    408                                                 if ( unify( formalType, cnst->get_type(), resultEnv, resultNeed, resultHave, openVars, indexer ) ) {
    409                                                         // xxx - Don't know if this is right
    410                                                         *out++ = cnstexpr->clone();
    411                                                         return true;
     405                                if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( si->get_value() ) ) {
     406                                        // so far, only constant expressions are accepted as default values
     407                                        if ( ConstantExpr *cnstexpr = dynamic_cast<ConstantExpr *>( castExpr->get_arg() ) ) {
     408                                                if ( Constant *cnst = dynamic_cast<Constant *>( cnstexpr->get_constant() ) ) {
     409                                                        if ( unify( formalType, cnst->get_type(), resultEnv, resultNeed, resultHave, openVars, indexer ) ) {
     410                                                                *out++ = cnstexpr->clone();
     411                                                                return true;
     412                                                        } // if
    412413                                                } // if
    413414                                        } // if
    414                                 } // if
     415                                }
    415416                        } // if
    416417                        return false;
Note: See TracChangeset for help on using the changeset viewer.