Changeset 0f5e8cd


Ignore:
Timestamp:
Jun 1, 2024, 5:13:42 PM (6 weeks ago)
Author:
Fangren Yu <f37yu@…>
Branches:
master
Children:
83b2fb5e, d68de59
Parents:
822332e
Message:

attempt to fix #286

Location:
src/ResolvExpr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CandidateFinder.cpp

    r822332e r0f5e8cd  
    11961196                        // return casts are eliminated (merely selecting an overload, no actual operation)
    11971197                        candidates = std::move(finder.candidates);
    1198                 }
    1199                 finder.find( castExpr->arg, ResolveMode::withAdjustment() );
     1198                        return;
     1199                }
     1200                else if (toType->isVoid()) {
     1201                        finder.find( castExpr->arg ); // no adjust
     1202                }
     1203                else {
     1204                        finder.find( castExpr->arg, ResolveMode::withAdjustment() );
     1205                }
    12001206
    12011207                if ( !finder.candidates.empty() ) reason.code = NoMatch;
  • src/ResolvExpr/Resolver.cpp

    r822332e r0f5e8cd  
    255255        ast::ptr< ast::CastExpr > untyped = new ast::CastExpr{ expr };
    256256        CandidateRef choice = findUnfinishedKindExpression(
    257                 untyped, context, "", anyCandidate, ResolveMode::withAdjustment() );
     257                untyped, context, "", anyCandidate );
    258258
    259259        // a cast expression has either 0 or 1 interpretations (by language rules);
Note: See TracChangeset for help on using the changeset viewer.