Changeset 2810700 for src/ResolvExpr


Ignore:
Timestamp:
Feb 22, 2024, 1:43:00 PM (10 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
2beaf9b
Parents:
7bb516f
Message:

The two argument form of the conditional operator now only has two arguments all the way to the resolver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CandidateFinder.cpp

    r7bb516f r2810700  
    15121512        void Finder::postvisit( const ast::ConditionalExpr * conditionalExpr ) {
    15131513                // candidates for condition
     1514                ast::ptr<ast::Expr> arg1 = notZeroExpr( conditionalExpr->arg1 );
    15141515                CandidateFinder finder1( context, tenv );
    1515                 ast::ptr<ast::Expr> arg1 = notZeroExpr( conditionalExpr->arg1 );
    15161516                finder1.find( arg1, ResolveMode::withAdjustment() );
    15171517                if ( finder1.candidates.empty() ) return;
    15181518
    15191519                // candidates for true result
     1520                ast::Expr const * arg2 = conditionalExpr->arg2;
     1521                arg2 = arg2 ? arg2 : conditionalExpr->arg1.get();
    15201522                CandidateFinder finder2( context, tenv );
    15211523                finder2.allowVoid = true;
    1522                 finder2.find( conditionalExpr->arg2, ResolveMode::withAdjustment() );
     1524                finder2.find( arg2, ResolveMode::withAdjustment() );
    15231525                if ( finder2.candidates.empty() ) return;
    15241526
Note: See TracChangeset for help on using the changeset viewer.