summaryrefslogtreecommitdiffstats
path: root/test/Analysis/operator-calls.cpp
diff options
context:
space:
mode:
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