summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-02-01 17:13:26 +0000
committerHans Wennborg <hans@hanshq.net>2017-02-01 17:13:26 +0000
commitccd6729877c03d702cccf5f9a3c5d4c2df372ff1 (patch)
tree3e9ebd91d5d43e012c7c63917be55e00c0831d68 /lib/Sema/SemaExprCXX.cpp
parent5eb0ba0f845af0eb3cc9d2b594385435c368994a (diff)
Merging r293360:
------------------------------------------------------------------------ r293360 | gbiv | 2017-01-27 18:19:40 -0800 (Fri, 27 Jan 2017) | 11 lines Change how we handle diagnose_if attributes. This patch changes how we handle argument-dependent `diagnose_if` attributes. In particular, we now check them in the same place that we check for things like passing NULL to Nonnull args, etc. This is basically better in every way than how we were handling them before. :) This fixes PR31638, PR31639, and PR31640. Differential Revision: https://reviews.llvm.org/D28889 ------------------------------------------------------------------------ Merging r293369: ------------------------------------------------------------------------ r293369 | gbiv | 2017-01-27 20:16:32 -0800 (Fri, 27 Jan 2017) | 7 lines Attempt to unbreak buildbots. r293360 broke some ARM bots, because size_t on those targets is apparently `unsigned int`, not `unsigned long`. `sizeof(whatever)` should to give us a `size_t`, so we can just use the type of that instead. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@293784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r--lib/Sema/SemaExprCXX.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index b2fb33f534..3de677e37b 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -6712,6 +6712,11 @@ ExprResult Sema::BuildCXXMemberCallExpr(Expr *E, NamedDecl *FoundDecl,
CXXMemberCallExpr *CE =
new (Context) CXXMemberCallExpr(Context, ME, None, ResultType, VK,
Exp.get()->getLocEnd());
+
+ if (CheckFunctionCall(Method, CE,
+ Method->getType()->castAs<FunctionProtoType>()))
+ return ExprError();
+
return CE;
}