Changes in src/ResolvExpr/Resolver.cc [8f557161:251ce80]
- File:
-
- 1 edited
-
src/ResolvExpr/Resolver.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
r8f557161 r251ce80 1106 1106 1107 1107 /// Removes cast to type of argument (unlike StripCasts, also handles non-generated casts) 1108 void removeExtraneousCast( ast::ptr<ast::Expr> & expr ) {1108 void removeExtraneousCast( ast::ptr<ast::Expr> & expr, const ast::SymbolTable & symtab ) { 1109 1109 if ( const ast::CastExpr * castExpr = expr.as< ast::CastExpr >() ) { 1110 1110 if ( typesCompatible( castExpr->arg->result, castExpr->result ) ) { … … 1196 1196 ast::ptr< ast::Expr > castExpr = new ast::CastExpr{ untyped, type }; 1197 1197 ast::ptr< ast::Expr > newExpr = findSingleExpression( castExpr, context ); 1198 removeExtraneousCast( newExpr );1198 removeExtraneousCast( newExpr, context.symtab ); 1199 1199 return newExpr; 1200 1200 } … … 1261 1261 static size_t traceId; 1262 1262 Resolver_new( const ast::TranslationGlobal & global ) : 1263 ast::WithSymbolTable(ast::SymbolTable::ErrorDetection::ValidateOnAdd),1264 1263 context{ symtab, global } {} 1265 1264 Resolver_new( const ResolveContext & context ) : … … 1341 1340 auto mutAttr = mutate(attr); 1342 1341 mutAttr->params.front() = resolved; 1343 if (! result. hasKnownValue) {1342 if (! result.second) { 1344 1343 SemanticWarning(loc, Warning::GccAttributes, 1345 1344 toCString( name, " priorities must be integers from 0 to 65535 inclusive: ", arg ) ); 1346 1345 } 1347 1346 else { 1348 auto priority = result. knownValue;1347 auto priority = result.first; 1349 1348 if (priority < 101) { 1350 1349 SemanticWarning(loc, Warning::GccAttributes, … … 2041 2040 const ast::Type * initContext = currentObject.getCurrentType(); 2042 2041 2043 removeExtraneousCast( newExpr );2042 removeExtraneousCast( newExpr, symtab ); 2044 2043 2045 2044 // check if actual object's type is char[]
Note:
See TracChangeset
for help on using the changeset viewer.