Skip to content

Commit 3f86287

Browse files
committed
address feedback
1 parent 6e17e8e commit 3f86287

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
@@ -6603,15 +6603,14 @@ ExprResult Sema::BuildCallExpr(Scope *Scope, Expr *Fn, SourceLocation LParenLoc,
66036603
*this, dyn_cast<UnresolvedMemberExpr>(Fn->IgnoreParens()),
66046604
Fn->getBeginLoc());
66056605

6606-
if (!Fn->getType()->isDependentType()) {
6607-
// If the type of the function itself is not dependent
6608-
// check that it is a reasonable as a function, as type deduction
6609-
// later assume the CallExpr has a sensible TYPE.
6610-
if (!MayBeFunctionType(Context, Fn->getType()))
6611-
return ExprError(
6612-
Diag(LParenLoc, diag::err_typecheck_call_not_function)
6613-
<< Fn->getType() << Fn->getSourceRange());
6614-
}
6606+
// If the type of the function itself is not dependent
6607+
// check that it is a reasonable as a function, as type deduction
6608+
// later assume the CallExpr has a sensible TYPE.
6609+
if (!Fn->getType()->isDependentType() &&
6610+
!MayBeFunctionType(Context, Fn->getType()))
6611+
return ExprError(
6612+
Diag(LParenLoc, diag::err_typecheck_call_not_function)
6613+
<< Fn->getType() << Fn->getSourceRange());
66156614

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

0 commit comments

Comments
 (0)