aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/member-expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/member-expr.cpp')
-rw-r--r--test/Analysis/member-expr.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/Analysis/member-expr.cpp b/test/Analysis/member-expr.cpp
index cf437387d6a6..f8dd324e9857 100644
--- a/test/Analysis/member-expr.cpp
+++ b/test/Analysis/member-expr.cpp
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection %s -verify
+void clang_analyzer_checkInlined(bool);
void clang_analyzer_eval(int);
namespace EnumsViaMemberExpr {
@@ -20,4 +21,21 @@ namespace EnumsViaMemberExpr {
void testEnumPtr(Foo *Baz) {
clang_analyzer_eval(Baz->Bar == Foo::Bar); // expected-warning{{TRUE}}
}
-} \ No newline at end of file
+}
+
+namespace PR19531 {
+ struct A {
+ A() : x(0) {}
+ bool h() const;
+ int x;
+ };
+
+ struct B {
+ void g(bool (A::*mp_f)() const) {
+ // This used to trigger an assertion because the 'this' pointer is a
+ // temporary.
+ (A().*mp_f)();
+ }
+ void f() { g(&A::h); }
+ };
+}