summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorKaelyn Takata <rikka@google.com>2014-11-25 23:04:09 +0000
committerKaelyn Takata <rikka@google.com>2014-11-25 23:04:09 +0000
commit443d61d62a36d2bca03ea98db5a0e811638d46b5 (patch)
tree476e9468cff11f92f198ee1848c0158b287fdf9b /clang/lib/Sema/SemaExpr.cpp
parent371417db347317ffff9c9469b5ed85a6b3e98382 (diff)
downloadbcm5719-llvm-443d61d62a36d2bca03ea98db5a0e811638d46b5.tar.gz
bcm5719-llvm-443d61d62a36d2bca03ea98db5a0e811638d46b5.zip
Ensure that any TypoExprs in the arguments to bultins with custom type
checking are handled before the custom type checking is performed. Fixes PR21669. llvm-svn: 222797
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 223e93e7c3d..ae299c3c98e 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -4752,8 +4752,12 @@ Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
VK_RValue, RParenLoc);
// Bail out early if calling a builtin with custom typechecking.
- if (BuiltinID && Context.BuiltinInfo.hasCustomTypechecking(BuiltinID))
- return CheckBuiltinFunctionCall(FDecl, BuiltinID, TheCall);
+ if (BuiltinID && Context.BuiltinInfo.hasCustomTypechecking(BuiltinID)) {
+ ExprResult Res = CorrectDelayedTyposInExpr(TheCall);
+ if (!Res.isUsable() || !isa<CallExpr>(Res.get()))
+ return Res;
+ return CheckBuiltinFunctionCall(FDecl, BuiltinID, cast<CallExpr>(Res.get()));
+ }
retry:
const FunctionType *FuncT;
OpenPOWER on IntegriCloud