Skip to content

Commit

Permalink
[clang][Sema][NFC] Clean up BuildOverloadedCallExpr
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed Jan 8, 2024
1 parent 4a45648 commit f0f16be
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions clang/lib/Sema/SemaOverload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13999,17 +13999,14 @@ ExprResult Sema::BuildOverloadedCallExpr(Scope *S, Expr *Fn,
// encloses the call and whose return type contains a placeholder type as if
// the UnresolvedLookupExpr was type-dependent.
if (OverloadResult == OR_Success) {
FunctionDecl *FDecl = Best->Function;
const FunctionDecl *FDecl = Best->Function;
if (FDecl && FDecl->isTemplateInstantiation() &&
FDecl->getReturnType()->isUndeducedType()) {
if (auto TP = FDecl->getTemplateInstantiationPattern(false)) {
if (TP->willHaveBody()) {
CallExpr *CE =
CallExpr::Create(Context, Fn, Args, Context.DependentTy,
VK_PRValue, RParenLoc, CurFPFeatureOverrides());
result = CE;
return result;
}
if (const auto *TP =
FDecl->getTemplateInstantiationPattern(/*ForDefinition=*/false);
TP && TP->willHaveBody()) {
return CallExpr::Create(Context, Fn, Args, Context.DependentTy,
VK_PRValue, RParenLoc, CurFPFeatureOverrides());
}
}
}
Expand Down

0 comments on commit f0f16be

Please sign in to comment.