Changeset b7b3e41 for src/ResolvExpr/Resolver.cc
- Timestamp:
- Jun 19, 2023, 1:57:11 PM (3 years ago)
- Branches:
- master
- Children:
- adc73a5
- Parents:
- fa5e1aa5 (diff), 33d4bc8 (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. - File:
-
- 1 edited
-
src/ResolvExpr/Resolver.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
rfa5e1aa5 rb7b3e41 1011 1011 ast::TypeEnvironment env; 1012 1012 CandidateFinder finder( context, env ); 1013 finder.allowVoid = true; 1013 1014 finder.find( untyped, recursion_level == 1 ? mode.atTopLevel() : mode ); 1014 1015 --recursion_level; … … 1054 1055 1055 1056 // promote candidate.cvtCost to .cost 1056 promoteCvtCost( winners );1057 // promoteCvtCost( winners ); 1057 1058 1058 1059 // produce ambiguous errors, if applicable … … 1106 1107 1107 1108 /// Removes cast to type of argument (unlike StripCasts, also handles non-generated casts) 1108 void removeExtraneousCast( ast::ptr<ast::Expr> & expr , const ast::SymbolTable & symtab) {1109 void removeExtraneousCast( ast::ptr<ast::Expr> & expr ) { 1109 1110 if ( const ast::CastExpr * castExpr = expr.as< ast::CastExpr >() ) { 1110 1111 if ( typesCompatible( castExpr->arg->result, castExpr->result ) ) { … … 1196 1197 ast::ptr< ast::Expr > castExpr = new ast::CastExpr{ untyped, type }; 1197 1198 ast::ptr< ast::Expr > newExpr = findSingleExpression( castExpr, context ); 1198 removeExtraneousCast( newExpr , context.symtab);1199 removeExtraneousCast( newExpr ); 1199 1200 return newExpr; 1200 1201 } … … 1261 1262 static size_t traceId; 1262 1263 Resolver_new( const ast::TranslationGlobal & global ) : 1264 ast::WithSymbolTable(ast::SymbolTable::ErrorDetection::ValidateOnAdd), 1263 1265 context{ symtab, global } {} 1264 1266 Resolver_new( const ResolveContext & context ) : … … 1340 1342 auto mutAttr = mutate(attr); 1341 1343 mutAttr->params.front() = resolved; 1342 if (! result. second) {1344 if (! result.hasKnownValue) { 1343 1345 SemanticWarning(loc, Warning::GccAttributes, 1344 1346 toCString( name, " priorities must be integers from 0 to 65535 inclusive: ", arg ) ); 1345 1347 } 1346 1348 else { 1347 auto priority = result. first;1349 auto priority = result.knownValue; 1348 1350 if (priority < 101) { 1349 1351 SemanticWarning(loc, Warning::GccAttributes, … … 2040 2042 const ast::Type * initContext = currentObject.getCurrentType(); 2041 2043 2042 removeExtraneousCast( newExpr , symtab);2044 removeExtraneousCast( newExpr ); 2043 2045 2044 2046 // check if actual object's type is char[]
Note:
See TracChangeset
for help on using the changeset viewer.