diff options
author | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
commit | 554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch) | |
tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /test/Analysis/operator-calls.cpp | |
parent | bb67ca86b31f67faee50bd10c3b036d65751745a (diff) | |
download | FreeBSD-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.cpp | 18 |
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}} +} |