Changeset 630bcb5
- Timestamp:
- Jun 6, 2018, 4:54:18 PM (6 years ago)
- 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, with_gc
- Children:
- 2a6c115
- Parents:
- 214e8da
- Location:
- src/ResolvExpr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
r214e8da r630bcb5 176 176 selected[ mangleName ] = current; 177 177 } else if ( candidate->cost == mapPlace->second.candidate->cost ) { 178 PRINT( 179 std::cerr << "marking ambiguous" << std::endl; 180 ) 181 mapPlace->second.isAmbiguous = true; 178 // if one of the candidates contains a deleted identifier, can pick the other, since 179 // deleted expressions should not be ambiguous if there is another option that is at least as good 180 if ( findDeletedExpr( candidate->expr ) ) { 181 // do nothing 182 PRINT( std::cerr << "candidate is deleted" << std::endl; ) 183 } else if ( findDeletedExpr( mapPlace->second.candidate->expr ) ) { 184 PRINT( std::cerr << "current is deleted" << std::endl; ) 185 selected[ mangleName ] = current; 186 } else { 187 PRINT( 188 std::cerr << "marking ambiguous" << std::endl; 189 ) 190 mapPlace->second.isAmbiguous = true; 191 } 182 192 } else { 183 193 PRINT( … … 611 621 ConstantExpr* getDefaultValue( Initializer* init ) { 612 622 if ( SingleInit* si = dynamic_cast<SingleInit*>( init ) ) { 613 if ( CastExpr* ce = dynamic_cast<CastExpr*>( si->get_value() ) ) { 614 return dynamic_cast<ConstantExpr*>( ce->get_arg() ); 623 if ( CastExpr* ce = dynamic_cast<CastExpr*>( si->value ) ) { 624 return dynamic_cast<ConstantExpr*>( ce->arg ); 625 } else { 626 return dynamic_cast<ConstantExpr*>( si->value ); 615 627 } 616 628 } … … 1065 1077 funcFinder.findWithAdjustment( untypedExpr->function ); 1066 1078 // if there are no function alternatives, then proceeding is a waste of time. 1079 // xxx - findWithAdjustment throws, so this check and others like it shouldn't be necessary. 1067 1080 if ( funcFinder.alternatives.empty() ) return; 1068 1081 -
src/ResolvExpr/Resolver.h
r214e8da r630bcb5 36 36 void resolveCtorInit( ConstructorInit * ctorInit, const SymTab::Indexer & indexer ); 37 37 void resolveStmtExpr( StmtExpr * stmtExpr, const SymTab::Indexer & indexer ); 38 /// Searches expr and returns the first DeletedExpr found, otherwise nullptr 39 DeletedExpr * findDeletedExpr( Expression * expr ); 38 40 } // namespace ResolvExpr 39 41
Note: See TracChangeset
for help on using the changeset viewer.