- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ConversionCost.cc
ref1da0e2 re874605 340 340 } else if ( const EnumInstType * enumInst = dynamic_cast< const EnumInstType * >( dest ) ) { 341 341 const EnumDecl * base_enum = enumInst->baseEnum; 342 if ( const Type * base = base_enum->base ) { // if the base enum has a base (if it is typed)342 if ( const Type * base = base_enum->base ) { 343 343 if ( const BasicType * enumBaseAstBasic = dynamic_cast< const BasicType *> (base) ) { 344 344 conversionCostFromBasicToBasic(basicType, enumBaseAstBasic); … … 634 634 } else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) { 635 635 const ast::EnumDecl * enumDecl = enumInst->base.get(); 636 if ( const ast::Type * enumType = enumDecl->base.get() ) { 636 if ( enumDecl->isTyped && !enumDecl->base.get() ) { 637 cost = Cost::infinity; 638 } else if ( const ast::Type * enumType = enumDecl->base.get() ) { 637 639 if ( const ast::BasicType * enumTypeAsBasic = dynamic_cast<const ast::BasicType *>(enumType) ) { 638 640 conversionCostFromBasicToBasic( basicType, enumTypeAsBasic ); … … 716 718 const ast::EnumDecl * baseEnum = enumInstType->base; 717 719 if ( const ast::Type * baseType = baseEnum->base ) { 718 cost = costCalc( baseType, dst, srcIsLvalue, symtab, env );720 costCalc( baseType, dst, srcIsLvalue, symtab, env ); 719 721 } else { 720 (void)enumInstType;721 722 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) }; 722 723 cost = costCalc( integer, dst, srcIsLvalue, symtab, env );
Note: See TracChangeset
for help on using the changeset viewer.