Skip to content

Commit f0f16be

Browse files
committed
[clang][Sema][NFC] Clean up BuildOverloadedCallExpr
1 parent 4a45648 commit f0f16be

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

clang/lib/Sema/SemaOverload.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13999,17 +13999,14 @@ ExprResult Sema::BuildOverloadedCallExpr(Scope *S, Expr *Fn,
1399913999
// encloses the call and whose return type contains a placeholder type as if
1400014000
// the UnresolvedLookupExpr was type-dependent.
1400114001
if (OverloadResult == OR_Success) {
14002-
FunctionDecl *FDecl = Best->Function;
14002+
const FunctionDecl *FDecl = Best->Function;
1400314003
if (FDecl && FDecl->isTemplateInstantiation() &&
1400414004
FDecl->getReturnType()->isUndeducedType()) {
14005-
if (auto TP = FDecl->getTemplateInstantiationPattern(false)) {
14006-
if (TP->willHaveBody()) {
14007-
CallExpr *CE =
14008-
CallExpr::Create(Context, Fn, Args, Context.DependentTy,
14009-
VK_PRValue, RParenLoc, CurFPFeatureOverrides());
14010-
result = CE;
14011-
return result;
14012-
}
14005+
if (const auto *TP =
14006+
FDecl->getTemplateInstantiationPattern(/*ForDefinition=*/false);
14007+
TP && TP->willHaveBody()) {
14008+
return CallExpr::Create(Context, Fn, Args, Context.DependentTy,
14009+
VK_PRValue, RParenLoc, CurFPFeatureOverrides());
1401314010
}
1401414011
}
1401514012
}

0 commit comments

Comments
 (0)