Skip to content

Commit 0dff457

Browse files
committed
address feedback
1 parent 4c87a81 commit 0dff457

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6612,15 +6612,14 @@ ExprResult Sema::BuildCallExpr(Scope *Scope, Expr *Fn, SourceLocation LParenLoc,
66126612
*this, dyn_cast<UnresolvedMemberExpr>(Fn->IgnoreParens()),
66136613
Fn->getBeginLoc());
66146614

6615-
if (!Fn->getType()->isDependentType()) {
6616-
// If the type of the function itself is not dependent
6617-
// check that it is a reasonable as a function, as type deduction
6618-
// later assume the CallExpr has a sensible TYPE.
6619-
if (!MayBeFunctionType(Context, Fn->getType()))
6620-
return ExprError(
6621-
Diag(LParenLoc, diag::err_typecheck_call_not_function)
6622-
<< Fn->getType() << Fn->getSourceRange());
6623-
}
6615+
// If the type of the function itself is not dependent
6616+
// check that it is a reasonable as a function, as type deduction
6617+
// later assume the CallExpr has a sensible TYPE.
6618+
if (!Fn->getType()->isDependentType() &&
6619+
!MayBeFunctionType(Context, Fn->getType()))
6620+
return ExprError(
6621+
Diag(LParenLoc, diag::err_typecheck_call_not_function)
6622+
<< Fn->getType() << Fn->getSourceRange());
66246623

66256624
return CallExpr::Create(Context, Fn, ArgExprs, Context.DependentTy,
66266625
VK_PRValue, RParenLoc, CurFPFeatureOverrides());

0 commit comments

Comments
 (0)