aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2013-01-24 02:03:08 +0000
committerNick Lewycky <nicholas@mxc.ca>2013-01-24 02:03:08 +0000
commit9b7ea0d2cc86c949ed70ad810f51ff34c7ce2f83 (patch)
treeb34b6c62cf964f4f4c6e85a395a8bedf9f04f170 /lib/Sema/SemaOverload.cpp
parent5d9484da2168e20a70a16938bd8dee86ac82521a (diff)
Start checking nonnull (as well as format and argument_with_type_tag) on
overloaded binary operators. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 91d02dacc8..e1c3d6839d 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -10336,6 +10336,13 @@ Sema::CreateOverloadedBinOp(SourceLocation OpLoc,
FnDecl))
return ExprError();
+ ArrayRef<const Expr *> ArgsArray(Args, 2);
+ // Cut off the implicit 'this'.
+ if (isa<CXXMethodDecl>(FnDecl))
+ ArgsArray = ArgsArray.slice(1);
+ checkCall(FnDecl, ArgsArray, 0, isa<CXXMethodDecl>(FnDecl), OpLoc,
+ TheCall->getSourceRange(), VariadicDoesNotApply);
+
return MaybeBindToTemporary(TheCall);
} else {
// We matched a built-in operator. Convert the arguments, then