Changeset 00eaeb8 for src/ResolvExpr
- Timestamp:
- Mar 1, 2024, 4:32:35 PM (7 months ago)
- Branches:
- master
- Children:
- bbf2cb1
- Parents:
- f1149ac
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ConversionCost.cc
rf1149ac r00eaeb8 288 288 cost = Cost::unsafe; 289 289 } 290 } else if ( dynamic_cast< const ast::EnumPosType *>(dst) ) { 291 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) }; 292 cost = costCalc( basicType, integer, srcIsLvalue, symtab, env ); 290 293 } 291 294 } … … 366 369 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) }; 367 370 cost = costCalc( integer, dst, srcIsLvalue, symtab, env ); 368 // }369 371 if ( cost < Cost::unsafe ) { 370 372 cost.incSafe(); … … 373 375 374 376 void ConversionCost::postvisit( const ast::EnumPosType * ) { 375 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) }; 376 cost = costCalc( integer, dst, srcIsLvalue, symtab, env ); 377 if ( cost < Cost::unsafe ) { 378 cost.incSafe(); 379 } 377 if ( dynamic_cast<const ast::EnumPosType *>( dst ) ) { 378 // Tempoarary 379 cost = Cost::zero; 380 } else { 381 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) }; 382 cost = costCalc( integer, dst, srcIsLvalue, symtab, env ); 383 if ( cost < Cost::unsafe ) { 384 cost.incSafe(); 385 } 386 } 387 380 388 } 381 389
Note: See TracChangeset
for help on using the changeset viewer.