Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CastCost.cpp

    r85855b0 rd3aa55e9  
    5353                void postvisit( const ast::EnumInstType * enumInst ) {
    5454                        cost = conversionCost( enumInst, dst, srcIsLvalue, symtab, env );
     55
     56                        if (Cost::unsafe < cost) {
     57                                static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicKind::SignedInt ) };
     58                                Cost intCost = costCalc( integer, dst, srcIsLvalue, symtab, env );
     59                                cost = intCost < cost? intCost: cost;
     60                        }
     61                        if ( enumInst->base->isTyped && enumInst->base->base ) {
     62                                auto baseConversionCost =
     63                                        castCost( enumInst->base->base, dst, srcIsLvalue, symtab, env );
     64                                cost = baseConversionCost < cost? baseConversionCost: cost;
     65                        }
    5566                }
    5667
Note: See TracChangeset for help on using the changeset viewer.