diff options
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index fb66bc7db34..ddf58aba1eb 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -191,22 +191,12 @@ static bool SemaBuiltinAddressof(Sema &S, CallExpr *TheCall) { return false; } -/// Check the number of arguments and arg type, and set the result type to +/// Check the number of arguments and set the result type to /// the argument type. static bool SemaBuiltinPreserveAI(Sema &S, CallExpr *TheCall) { if (checkArgCount(S, TheCall, 1)) return true; - // The argument type must be a pointer - ExprResult Arg = TheCall->getArg(0); - QualType Ty = Arg.get()->getType(); - if (!Ty->isPointerType()) { - S.Diag(Arg.get()->getBeginLoc(), - diag::err_builtin_preserve_access_index_invalid_arg) - << Ty << Arg.get()->getSourceRange(); - return true; - } - TheCall->setType(TheCall->getArg(0)->getType()); return false; } |