Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    rb230091 r4559b34  
    99// Author           : Aaron B. Moss
    1010// Created On       : Sun May 17 12:17:01 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Mar 18 10:41:00 2022
    13 // Update Count     : 247
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue Feb  1 16:27:14 2022
     13// Update Count     : 245
    1414//
    1515
     
    997997                /// Calls the CandidateFinder and finds the single best candidate
    998998                CandidateRef findUnfinishedKindExpression(
    999                         const ast::Expr * untyped, const ResolveContext & context, const std::string & kind,
     999                        const ast::Expr * untyped, const ast::SymbolTable & symtab, const std::string & kind,
    10001000                        std::function<bool(const Candidate &)> pred = anyCandidate, ResolvMode mode = {}
    10011001                ) {
     
    10071007                        ++recursion_level;
    10081008                        ast::TypeEnvironment env;
    1009                         CandidateFinder finder( context, env );
     1009                        CandidateFinder finder{ symtab, env };
    10101010                        finder.find( untyped, recursion_level == 1 ? mode.atTopLevel() : mode );
    10111011                        --recursion_level;
     
    11291129
    11301130        ast::ptr< ast::Expr > resolveInVoidContext(
    1131                 const ast::Expr * expr, const ResolveContext & context,
    1132                 ast::TypeEnvironment & env
     1131                const ast::Expr * expr, const ast::SymbolTable & symtab, ast::TypeEnvironment & env
    11331132        ) {
    11341133                assertf( expr, "expected a non-null expression" );
     
    11371136                ast::ptr< ast::CastExpr > untyped = new ast::CastExpr{ expr };
    11381137                CandidateRef choice = findUnfinishedKindExpression(
    1139                         untyped, context, "", anyCandidate, ResolvMode::withAdjustment() );
     1138                        untyped, symtab, "", anyCandidate, ResolvMode::withAdjustment() );
    11401139
    11411140                // a cast expression has either 0 or 1 interpretations (by language rules);
     
    11501149                /// context.
    11511150                ast::ptr< ast::Expr > findVoidExpression(
    1152                         const ast::Expr * untyped, const ResolveContext & context
     1151                        const ast::Expr * untyped, const ast::SymbolTable & symtab
    11531152                ) {
    11541153                        ast::TypeEnvironment env;
    1155                         ast::ptr< ast::Expr > newExpr = resolveInVoidContext( untyped, context, env );
     1154                        ast::ptr< ast::Expr > newExpr = resolveInVoidContext( untyped, symtab, env );
    11561155                        finishExpr( newExpr, env, untyped->env );
    11571156                        return newExpr;
     
    11641163                /// lowest cost, returning the resolved version
    11651164                ast::ptr< ast::Expr > findKindExpression(
    1166                         const ast::Expr * untyped, const ResolveContext & context,
     1165                        const ast::Expr * untyped, const ast::SymbolTable & symtab,
    11671166                        std::function<bool(const Candidate &)> pred = anyCandidate,
    11681167                        const std::string & kind = "", ResolvMode mode = {}
     
    11701169                        if ( ! untyped ) return {};
    11711170                        CandidateRef choice =
    1172                                 findUnfinishedKindExpression( untyped, context, kind, pred, mode );
     1171                                findUnfinishedKindExpression( untyped, symtab, kind, pred, mode );
    11731172                        ResolvExpr::finishExpr( choice->expr, choice->env, untyped->env );
    11741173                        return std::move( choice->expr );
     
    11771176                /// Resolve `untyped` to the single expression whose candidate is the best match
    11781177                ast::ptr< ast::Expr > findSingleExpression(
    1179                         const ast::Expr * untyped, const ResolveContext & context
     1178                        const ast::Expr * untyped, const ast::SymbolTable & symtab
    11801179                ) {
    11811180                        Stats::ResolveTime::start( untyped );
    1182                         auto res = findKindExpression( untyped, context );
     1181                        auto res = findKindExpression( untyped, symtab );
    11831182                        Stats::ResolveTime::stop();
    11841183                        return res;
     
    11871186
    11881187        ast::ptr< ast::Expr > findSingleExpression(
    1189                 const ast::Expr * untyped, const ast::Type * type,
    1190                 const ResolveContext & context
     1188                const ast::Expr * untyped, const ast::Type * type, const ast::SymbolTable & symtab
    11911189        ) {
    11921190                assert( untyped && type );
    11931191                ast::ptr< ast::Expr > castExpr = new ast::CastExpr{ untyped, type };
    1194                 ast::ptr< ast::Expr > newExpr = findSingleExpression( castExpr, context );
    1195                 removeExtraneousCast( newExpr, context.symtab );
     1192                ast::ptr< ast::Expr > newExpr = findSingleExpression( castExpr, symtab );
     1193                removeExtraneousCast( newExpr, symtab );
    11961194                return newExpr;
    11971195        }
     
    12191217                /// Resolve `untyped` as an integral expression, returning the resolved version
    12201218                ast::ptr< ast::Expr > findIntegralExpression(
    1221                         const ast::Expr * untyped, const ResolveContext & context
     1219                        const ast::Expr * untyped, const ast::SymbolTable & symtab
    12221220                ) {
    1223                         return findKindExpression( untyped, context, hasIntegralType, "condition" );
     1221                        return findKindExpression( untyped, symtab, hasIntegralType, "condition" );
    12241222                }
    12251223
     
    12511249                // for work previously in GenInit
    12521250                static InitTweak::ManagedTypes_new managedTypes;
    1253                 ResolveContext context;
    12541251
    12551252                bool inEnumDecl = false;
     
    12571254        public:
    12581255                static size_t traceId;
    1259                 Resolver_new( const ast::TranslationGlobal & global ) :
    1260                         context{ symtab, global } {}
    1261                 Resolver_new( const ResolveContext & context ) :
    1262                         ast::WithSymbolTable{ context.symtab },
    1263                         context{ symtab, context.global } {}
     1256                Resolver_new() = default;
     1257                Resolver_new( const ast::SymbolTable & syms ) { symtab = syms; }
    12641258
    12651259                const ast::FunctionDecl * previsit( const ast::FunctionDecl * );
     
    12781272                const ast::AsmStmt *         previsit( const ast::AsmStmt * );
    12791273                const ast::IfStmt *          previsit( const ast::IfStmt * );
    1280                 const ast::WhileDoStmt *     previsit( const ast::WhileDoStmt * );
     1274                const ast::WhileDoStmt *       previsit( const ast::WhileDoStmt * );
    12811275                const ast::ForStmt *         previsit( const ast::ForStmt * );
    12821276                const ast::SwitchStmt *      previsit( const ast::SwitchStmt * );
    1283                 const ast::CaseClause *      previsit( const ast::CaseClause * );
     1277                const ast::CaseStmt *        previsit( const ast::CaseStmt * );
    12841278                const ast::BranchStmt *      previsit( const ast::BranchStmt * );
    12851279                const ast::ReturnStmt *      previsit( const ast::ReturnStmt * );
    12861280                const ast::ThrowStmt *       previsit( const ast::ThrowStmt * );
    1287                 const ast::CatchClause *     previsit( const ast::CatchClause * );
    1288                 const ast::CatchClause *     postvisit( const ast::CatchClause * );
     1281                const ast::CatchStmt *       previsit( const ast::CatchStmt * );
     1282                const ast::CatchStmt *       postvisit( const ast::CatchStmt * );
    12891283                const ast::WaitForStmt *     previsit( const ast::WaitForStmt * );
    12901284                const ast::WithStmt *        previsit( const ast::WithStmt * );
     
    13051299
    13061300        void resolve( ast::TranslationUnit& translationUnit ) {
    1307                 ast::Pass< Resolver_new >::run( translationUnit, translationUnit.global );
     1301                ast::Pass< Resolver_new >::run( translationUnit );
    13081302        }
    13091303
    13101304        ast::ptr< ast::Init > resolveCtorInit(
    1311                 const ast::ConstructorInit * ctorInit, const ResolveContext & context
     1305                const ast::ConstructorInit * ctorInit, const ast::SymbolTable & symtab
    13121306        ) {
    13131307                assert( ctorInit );
    1314                 ast::Pass< Resolver_new > resolver( context );
     1308                ast::Pass< Resolver_new > resolver{ symtab };
    13151309                return ctorInit->accept( resolver );
    13161310        }
    13171311
    13181312        const ast::Expr * resolveStmtExpr(
    1319                 const ast::StmtExpr * stmtExpr, const ResolveContext & context
     1313                const ast::StmtExpr * stmtExpr, const ast::SymbolTable & symtab
    13201314        ) {
    13211315                assert( stmtExpr );
    1322                 ast::Pass< Resolver_new > resolver( context );
     1316                ast::Pass< Resolver_new > resolver{ symtab };
    13231317                auto ret = mutate(stmtExpr->accept(resolver));
    13241318                strict_dynamic_cast< ast::StmtExpr * >( ret )->computeResult();
     
    13271321
    13281322        namespace {
    1329                 const ast::Attribute * handleAttribute(const CodeLocation & loc, const ast::Attribute * attr, const ResolveContext & context) {
     1323                const ast::Attribute * handleAttribute(const CodeLocation & loc, const ast::Attribute * attr, const ast::SymbolTable & symtab) {
    13301324                        std::string name = attr->normalizedName();
    13311325                        if (name == "constructor" || name == "destructor") {
    13321326                                if (attr->params.size() == 1) {
    13331327                                        auto arg = attr->params.front();
    1334                                         auto resolved = ResolvExpr::findSingleExpression( arg, new ast::BasicType( ast::BasicType::LongLongSignedInt ), context );
     1328                                        auto resolved = ResolvExpr::findSingleExpression( arg, new ast::BasicType( ast::BasicType::LongLongSignedInt ), symtab );
    13351329                                        auto result = eval(arg);
    13361330
     
    13751369
    13761370                        for (auto & attr: mutDecl->attributes) {
    1377                                 attr = handleAttribute(mutDecl->location, attr, context );
     1371                                attr = handleAttribute(mutDecl->location, attr, symtab);
    13781372                        }
    13791373
     
    13851379                        for (auto & typeParam : mutDecl->type_params) {
    13861380                                symtab.addType(typeParam);
    1387                                 mutType->forall.emplace_back(new ast::TypeInstType(typeParam));
     1381                                mutType->forall.emplace_back(new ast::TypeInstType(typeParam->name, typeParam));
    13881382                        }
    13891383                        for (auto & asst : mutDecl->assertions) {
    1390                                 asst = fixObjectType(asst.strict_as<ast::ObjectDecl>(), context);
     1384                                asst = fixObjectType(asst.strict_as<ast::ObjectDecl>(), symtab);
    13911385                                symtab.addId(asst);
    13921386                                mutType->assertions.emplace_back(new ast::VariableExpr(functionDecl->location, asst));
     
    14001394
    14011395                        for (auto & param : mutDecl->params) {
    1402                                 param = fixObjectType(param.strict_as<ast::ObjectDecl>(), context);
     1396                                param = fixObjectType(param.strict_as<ast::ObjectDecl>(), symtab);
    14031397                                symtab.addId(param);
    14041398                                paramTypes.emplace_back(param->get_type());
    14051399                        }
    14061400                        for (auto & ret : mutDecl->returns) {
    1407                                 ret = fixObjectType(ret.strict_as<ast::ObjectDecl>(), context);
     1401                                ret = fixObjectType(ret.strict_as<ast::ObjectDecl>(), symtab);
    14081402                                returnTypes.emplace_back(ret->get_type());
    14091403                        }
     
    14761470                        // enumerator initializers should not use the enum type to initialize, since the
    14771471                        // enum type is still incomplete at this point. Use `int` instead.
    1478                         objectDecl = fixObjectType(objectDecl, context);
    1479                         currentObject = ast::CurrentObject{
    1480                                 objectDecl->location, new ast::BasicType{ ast::BasicType::SignedInt } };
     1472
     1473                        if (dynamic_cast< const ast::EnumInstType * >( objectDecl->get_type() )->base->base) { // const ast::PointerType &
     1474                                const ast::Type * enumBase =  (dynamic_cast< const ast::EnumInstType * >( objectDecl->get_type() )->base->base.get());
     1475                                const ast::PointerType * enumBaseAsPtr = dynamic_cast<const ast::PointerType *>(enumBase);
     1476
     1477                                if ( enumBaseAsPtr ) {
     1478                                        const ast::Type * pointerBase = enumBaseAsPtr->base.get();
     1479                                        if ( dynamic_cast<const ast::BasicType *>(pointerBase) ) {
     1480                                                objectDecl = fixObjectType(objectDecl, symtab);
     1481                                                if (dynamic_cast<const ast::BasicType *>(pointerBase)->kind == ast::BasicType::Char)
     1482                                                currentObject = ast::CurrentObject{
     1483                                                        objectDecl->location,  new ast::PointerType{
     1484                                                                new ast::BasicType{ ast::BasicType::Char }
     1485                                                        } };
     1486                                        } else {
     1487                                                objectDecl = fixObjectType(objectDecl, symtab);
     1488                                                currentObject = ast::CurrentObject{objectDecl->location, new ast::BasicType{ ast::BasicType::SignedInt } };
     1489                                        }
     1490                                }
     1491                        } else {
     1492                                objectDecl = fixObjectType(objectDecl, symtab);
     1493                                currentObject = ast::CurrentObject{
     1494                                        objectDecl->location, new ast::BasicType{ ast::BasicType::SignedInt } };
     1495                        }
     1496
    14811497                }
    14821498                else {
    14831499                        if (!objectDecl->isTypeFixed) {
    1484                                 auto newDecl = fixObjectType(objectDecl, context);
     1500                                auto newDecl = fixObjectType(objectDecl, symtab);
    14851501                                auto mutDecl = mutate(newDecl);
    14861502
     
    15131529                        // nested type decls are hoisted already. no need to do anything
    15141530                        if (auto obj = member.as<ast::ObjectDecl>()) {
    1515                                 member = fixObjectType(obj, context);
     1531                                member = fixObjectType(obj, symtab);
    15161532                        }
    15171533                }
     
    15361552                return ast::mutate_field(
    15371553                        assertDecl, &ast::StaticAssertDecl::cond,
    1538                         findIntegralExpression( assertDecl->cond, context ) );
     1554                        findIntegralExpression( assertDecl->cond, symtab ) );
    15391555        }
    15401556
    15411557        template< typename PtrType >
    1542         const PtrType * handlePtrType( const PtrType * type, const ResolveContext & context ) {
     1558        const PtrType * handlePtrType( const PtrType * type, const ast::SymbolTable & symtab ) {
    15431559                if ( type->dimension ) {
    1544                         ast::ptr< ast::Type > sizeType = context.global.sizeType;
     1560                        ast::ptr< ast::Type > sizeType = ast::sizeType;
    15451561                        ast::mutate_field(
    15461562                                type, &PtrType::dimension,
    1547                                 findSingleExpression( type->dimension, sizeType, context ) );
     1563                                findSingleExpression( type->dimension, sizeType, symtab ) );
    15481564                }
    15491565                return type;
     
    15511567
    15521568        const ast::ArrayType * Resolver_new::previsit( const ast::ArrayType * at ) {
    1553                 return handlePtrType( at, context );
     1569                return handlePtrType( at, symtab );
    15541570        }
    15551571
    15561572        const ast::PointerType * Resolver_new::previsit( const ast::PointerType * pt ) {
    1557                 return handlePtrType( pt, context );
     1573                return handlePtrType( pt, symtab );
    15581574        }
    15591575
     
    15631579
    15641580                return ast::mutate_field(
    1565                         exprStmt, &ast::ExprStmt::expr, findVoidExpression( exprStmt->expr, context ) );
     1581                        exprStmt, &ast::ExprStmt::expr, findVoidExpression( exprStmt->expr, symtab ) );
    15661582        }
    15671583
     
    15701586
    15711587                asmExpr = ast::mutate_field(
    1572                         asmExpr, &ast::AsmExpr::operand, findVoidExpression( asmExpr->operand, context ) );
     1588                        asmExpr, &ast::AsmExpr::operand, findVoidExpression( asmExpr->operand, symtab ) );
    15731589
    15741590                return asmExpr;
     
    15841600        const ast::IfStmt * Resolver_new::previsit( const ast::IfStmt * ifStmt ) {
    15851601                return ast::mutate_field(
    1586                         ifStmt, &ast::IfStmt::cond, findIntegralExpression( ifStmt->cond, context ) );
     1602                        ifStmt, &ast::IfStmt::cond, findIntegralExpression( ifStmt->cond, symtab ) );
    15871603        }
    15881604
    15891605        const ast::WhileDoStmt * Resolver_new::previsit( const ast::WhileDoStmt * whileDoStmt ) {
    15901606                return ast::mutate_field(
    1591                         whileDoStmt, &ast::WhileDoStmt::cond, findIntegralExpression( whileDoStmt->cond, context ) );
     1607                        whileDoStmt, &ast::WhileDoStmt::cond, findIntegralExpression( whileDoStmt->cond, symtab ) );
    15921608        }
    15931609
     
    15951611                if ( forStmt->cond ) {
    15961612                        forStmt = ast::mutate_field(
    1597                                 forStmt, &ast::ForStmt::cond, findIntegralExpression( forStmt->cond, context ) );
     1613                                forStmt, &ast::ForStmt::cond, findIntegralExpression( forStmt->cond, symtab ) );
    15981614                }
    15991615
    16001616                if ( forStmt->inc ) {
    16011617                        forStmt = ast::mutate_field(
    1602                                 forStmt, &ast::ForStmt::inc, findVoidExpression( forStmt->inc, context ) );
     1618                                forStmt, &ast::ForStmt::inc, findVoidExpression( forStmt->inc, symtab ) );
    16031619                }
    16041620
     
    16101626                switchStmt = ast::mutate_field(
    16111627                        switchStmt, &ast::SwitchStmt::cond,
    1612                         findIntegralExpression( switchStmt->cond, context ) );
     1628                        findIntegralExpression( switchStmt->cond, symtab ) );
    16131629                currentObject = ast::CurrentObject{ switchStmt->location, switchStmt->cond->result };
    16141630                return switchStmt;
    16151631        }
    16161632
    1617         const ast::CaseClause * Resolver_new::previsit( const ast::CaseClause * caseStmt ) {
     1633        const ast::CaseStmt * Resolver_new::previsit( const ast::CaseStmt * caseStmt ) {
    16181634                if ( caseStmt->cond ) {
    16191635                        std::deque< ast::InitAlternative > initAlts = currentObject.getOptions();
     
    16231639                        ast::ptr< ast::Expr > untyped =
    16241640                                new ast::CastExpr{ caseStmt->location, caseStmt->cond, initAlts.front().type };
    1625                         ast::ptr< ast::Expr > newExpr = findSingleExpression( untyped, context );
     1641                        ast::ptr< ast::Expr > newExpr = findSingleExpression( untyped, symtab );
    16261642
    16271643                        // case condition cannot have a cast in C, so it must be removed here, regardless of
     
    16311647                        }
    16321648
    1633                         caseStmt = ast::mutate_field( caseStmt, &ast::CaseClause::cond, newExpr );
     1649                        caseStmt = ast::mutate_field( caseStmt, &ast::CaseStmt::cond, newExpr );
    16341650                }
    16351651                return caseStmt;
     
    16441660                        branchStmt = ast::mutate_field(
    16451661                                branchStmt, &ast::BranchStmt::computedTarget,
    1646                                 findSingleExpression( branchStmt->computedTarget, target, context ) );
     1662                                findSingleExpression( branchStmt->computedTarget, target, symtab ) );
    16471663                }
    16481664                return branchStmt;
     
    16541670                        returnStmt = ast::mutate_field(
    16551671                                returnStmt, &ast::ReturnStmt::expr,
    1656                                 findSingleExpression( returnStmt->expr, functionReturn, context ) );
     1672                                findSingleExpression( returnStmt->expr, functionReturn, symtab ) );
    16571673                }
    16581674                return returnStmt;
     
    16691685                        throwStmt = ast::mutate_field(
    16701686                                throwStmt, &ast::ThrowStmt::expr,
    1671                                 findSingleExpression( throwStmt->expr, exceptType, context ) );
     1687                                findSingleExpression( throwStmt->expr, exceptType, symtab ) );
    16721688                }
    16731689                return throwStmt;
    16741690        }
    16751691
    1676         const ast::CatchClause * Resolver_new::previsit( const ast::CatchClause * catchClause ) {
     1692        const ast::CatchStmt * Resolver_new::previsit( const ast::CatchStmt * catchStmt ) {
    16771693                // Until we are very sure this invarent (ifs that move between passes have then)
    16781694                // holds, check it. This allows a check for when to decode the mangling.
    1679                 if ( auto ifStmt = catchClause->body.as<ast::IfStmt>() ) {
     1695                if ( auto ifStmt = catchStmt->body.as<ast::IfStmt>() ) {
    16801696                        assert( ifStmt->then );
    16811697                }
    16821698                // Encode the catchStmt so the condition can see the declaration.
    1683                 if ( catchClause->cond ) {
    1684                         ast::CatchClause * clause = mutate( catchClause );
    1685                         clause->body = new ast::IfStmt( clause->location, clause->cond, nullptr, clause->body );
    1686                         clause->cond = nullptr;
    1687                         return clause;
    1688                 }
    1689                 return catchClause;
    1690         }
    1691 
    1692         const ast::CatchClause * Resolver_new::postvisit( const ast::CatchClause * catchClause ) {
     1699                if ( catchStmt->cond ) {
     1700                        ast::CatchStmt * stmt = mutate( catchStmt );
     1701                        stmt->body = new ast::IfStmt( stmt->location, stmt->cond, nullptr, stmt->body );
     1702                        stmt->cond = nullptr;
     1703                        return stmt;
     1704                }
     1705                return catchStmt;
     1706        }
     1707
     1708        const ast::CatchStmt * Resolver_new::postvisit( const ast::CatchStmt * catchStmt ) {
    16931709                // Decode the catchStmt so everything is stored properly.
    1694                 const ast::IfStmt * ifStmt = catchClause->body.as<ast::IfStmt>();
     1710                const ast::IfStmt * ifStmt = catchStmt->body.as<ast::IfStmt>();
    16951711                if ( nullptr != ifStmt && nullptr == ifStmt->then ) {
    16961712                        assert( ifStmt->cond );
    16971713                        assert( ifStmt->else_ );
    1698                         ast::CatchClause * clause = ast::mutate( catchClause );
    1699                         clause->cond = ifStmt->cond;
    1700                         clause->body = ifStmt->else_;
     1714                        ast::CatchStmt * stmt = ast::mutate( catchStmt );
     1715                        stmt->cond = ifStmt->cond;
     1716                        stmt->body = ifStmt->else_;
    17011717                        // ifStmt should be implicately deleted here.
    1702                         return clause;
    1703                 }
    1704                 return catchClause;
     1718                        return stmt;
     1719                }
     1720                return catchStmt;
    17051721        }
    17061722
     
    17131729
    17141730                        ast::TypeEnvironment env;
    1715                         CandidateFinder funcFinder( context, env );
     1731                        CandidateFinder funcFinder{ symtab, env };
    17161732
    17171733                        // Find all candidates for a function in canonical form
     
    19271943                                );
    19281944
    1929                                 clause2.target.args.emplace_back( findSingleExpression( init, context ) );
     1945                                clause2.target.args.emplace_back( findSingleExpression( init, symtab ) );
    19301946                        }
    19311947
    19321948                        // Resolve the conditions as if it were an IfStmt, statements normally
    1933                         clause2.cond = findSingleExpression( clause.cond, context );
     1949                        clause2.cond = findSingleExpression( clause.cond, symtab );
    19341950                        clause2.stmt = clause.stmt->accept( *visitor );
    19351951
     
    19461962                        ast::ptr< ast::Type > target =
    19471963                                new ast::BasicType{ ast::BasicType::LongLongUnsignedInt };
    1948                         timeout2.time = findSingleExpression( stmt->timeout.time, target, context );
    1949                         timeout2.cond = findSingleExpression( stmt->timeout.cond, context );
     1964                        timeout2.time = findSingleExpression( stmt->timeout.time, target, symtab );
     1965                        timeout2.cond = findSingleExpression( stmt->timeout.cond, symtab );
    19501966                        timeout2.stmt = stmt->timeout.stmt->accept( *visitor );
    19511967
     
    19601976                        ast::WaitForStmt::OrElse orElse2;
    19611977
    1962                         orElse2.cond = findSingleExpression( stmt->orElse.cond, context );
     1978                        orElse2.cond = findSingleExpression( stmt->orElse.cond, symtab );
    19631979                        orElse2.stmt = stmt->orElse.stmt->accept( *visitor );
    19641980
     
    19811997                for (auto & expr : exprs) {
    19821998                        // only struct- and union-typed expressions are viable candidates
    1983                         expr = findKindExpression( expr, context, structOrUnion, "with expression" );
     1999                        expr = findKindExpression( expr, symtab, structOrUnion, "with expression" );
    19842000
    19852001                        // if with expression might be impure, create a temporary so that it is evaluated once
     
    20072023                ast::ptr< ast::Expr > untyped = new ast::UntypedInitExpr{
    20082024                        singleInit->location, singleInit->value, currentObject.getOptions() };
    2009                 ast::ptr<ast::Expr> newExpr = findSingleExpression( untyped, context );
     2025                ast::ptr<ast::Expr> newExpr = findSingleExpression( untyped, symtab );
    20102026                const ast::InitExpr * initExpr = newExpr.strict_as< ast::InitExpr >();
    20112027
Note: See TracChangeset for help on using the changeset viewer.