summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorKaelyn Takata <rikka@google.com>2015-06-23 19:13:17 +0000
committerKaelyn Takata <rikka@google.com>2015-06-23 19:13:17 +0000
commit72d16a581bcd03bb77e6be2848b956db1dd93596 (patch)
tree8dfd512216d0537f8f995257e80c601756ac104b /clang/lib/Sema/SemaExpr.cpp
parentdf2eb7777dd2781df574ea38b2fc65f2c6bc5b4c (diff)
downloadbcm5719-llvm-72d16a581bcd03bb77e6be2848b956db1dd93596.tar.gz
bcm5719-llvm-72d16a581bcd03bb77e6be2848b956db1dd93596.zip
Make the typo resolution in r240441 apply to all function calls.
Regular function calls (such as to cabs()) run into the same problem with handling dependent exprs, not just builtins with custom type checking. Fixes PR23775. llvm-svn: 240443
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 5813a626b0f..2f3f4c55f10 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -4937,19 +4937,20 @@ Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
TheCall = new (Context) CallExpr(Context, Fn, Args, Context.BoolTy,
VK_RValue, RParenLoc);
+ if (!getLangOpts().CPlusPlus) {
+ // C cannot always handle TypoExpr nodes in builtin calls and direct
+ // function calls as their argument checking don't necessarily handle
+ // dependent types properly, so make sure any TypoExprs have been
+ // dealt with.
+ ExprResult Result = CorrectDelayedTyposInExpr(TheCall);
+ if (!Result.isUsable()) return ExprError();
+ TheCall = dyn_cast<CallExpr>(Result.get());
+ if (!TheCall) return Result;
+ }
+
// Bail out early if calling a builtin with custom typechecking.
- if (BuiltinID && Context.BuiltinInfo.hasCustomTypechecking(BuiltinID)) {
- if (!getLangOpts().CPlusPlus) {
- // C cannot handle TypoExpr nodes in the builtin's call expr because it
- // doesn't handle dependent types properly, so make sure any TypoExprs have
- // been dealt with.
- ExprResult Result = CorrectDelayedTyposInExpr(TheCall);
- if (!Result.isUsable()) return ExprError();
- TheCall = dyn_cast<CallExpr>(Result.get());
- if (!TheCall) return Result;
- }
+ if (BuiltinID && Context.BuiltinInfo.hasCustomTypechecking(BuiltinID))
return CheckBuiltinFunctionCall(FDecl, BuiltinID, TheCall);
- }
retry:
const FunctionType *FuncT;
OpenPOWER on IntegriCloud