summaryrefslogtreecommitdiffstats
path: root/test/Analysis/operator-calls.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
committerdim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
commit554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch)
tree9abb1a658a297776086f4e0dfa6ca533de02104e /test/Analysis/operator-calls.cpp
parentbb67ca86b31f67faee50bd10c3b036d65751745a (diff)
downloadFreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip
FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'test/Analysis/operator-calls.cpp')
-rw-r--r--test/Analysis/operator-calls.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/Analysis/operator-calls.cpp b/test/Analysis/operator-calls.cpp
index 73cd28a..dbc63bc 100644
--- a/test/Analysis/operator-calls.cpp
+++ b/test/Analysis/operator-calls.cpp
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core,debug.ExprInspection -analyzer-ipa=inlining -verify %s
+void clang_analyzer_eval(bool);
+
struct X0 { };
bool operator==(const X0&, const X0&);
@@ -14,3 +16,17 @@ void t2() {
bool PR7287(X0 a, X0 b) {
return operator==(a, b);
}
+
+
+// Inlining non-static member operators mistakenly treated 'this' as the first
+// argument for a while.
+
+struct IntComparable {
+ bool operator==(int x) const {
+ return x == 0;
+ }
+};
+
+void testMemberOperator(IntComparable B) {
+ clang_analyzer_eval(B == 0); // expected-warning{{TRUE}}
+}
OpenPOWER on IntegriCloud