From 443d61d62a36d2bca03ea98db5a0e811638d46b5 Mon Sep 17 00:00:00 2001 From: Kaelyn Takata Date: Tue, 25 Nov 2014 23:04:09 +0000 Subject: 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 --- clang/lib/Sema/SemaExpr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema/SemaExpr.cpp') 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(Res.get())) + return Res; + return CheckBuiltinFunctionCall(FDecl, BuiltinID, cast(Res.get())); + } retry: const FunctionType *FuncT; -- cgit v1.2.3