Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r8f557161 r251ce80  
    11061106
    11071107                /// 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 ) {
    11091109                        if ( const ast::CastExpr * castExpr = expr.as< ast::CastExpr >() ) {
    11101110                                if ( typesCompatible( castExpr->arg->result, castExpr->result ) ) {
     
    11961196                ast::ptr< ast::Expr > castExpr = new ast::CastExpr{ untyped, type };
    11971197                ast::ptr< ast::Expr > newExpr = findSingleExpression( castExpr, context );
    1198                 removeExtraneousCast( newExpr );
     1198                removeExtraneousCast( newExpr, context.symtab );
    11991199                return newExpr;
    12001200        }
     
    12611261                static size_t traceId;
    12621262                Resolver_new( const ast::TranslationGlobal & global ) :
    1263                         ast::WithSymbolTable(ast::SymbolTable::ErrorDetection::ValidateOnAdd),
    12641263                        context{ symtab, global } {}
    12651264                Resolver_new( const ResolveContext & context ) :
     
    13411340                                        auto mutAttr = mutate(attr);
    13421341                                        mutAttr->params.front() = resolved;
    1343                                         if (! result.hasKnownValue) {
     1342                                        if (! result.second) {
    13441343                                                SemanticWarning(loc, Warning::GccAttributes,
    13451344                                                        toCString( name, " priorities must be integers from 0 to 65535 inclusive: ", arg ) );
    13461345                                        }
    13471346                                        else {
    1348                                                 auto priority = result.knownValue;
     1347                                                auto priority = result.first;
    13491348                                                if (priority < 101) {
    13501349                                                        SemanticWarning(loc, Warning::GccAttributes,
     
    20412040                const ast::Type * initContext = currentObject.getCurrentType();
    20422041
    2043                 removeExtraneousCast( newExpr );
     2042                removeExtraneousCast( newExpr, symtab );
    20442043
    20452044                // check if actual object's type is char[]
Note: See TracChangeset for help on using the changeset viewer.