diff options
| author | Anders Carlsson <andersca@mac.com> | 2009-10-13 17:41:28 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2009-10-13 17:41:28 +0000 |
| commit | 3eea6350412eb7db13f0e2791c118920b36130a4 (patch) | |
| tree | 56b6ad51dda24ca641ad9b660ae65444c0496c0c /test/CodeGenCXX/member-function-pointers.cpp | |
| parent | e647d93be5a70e737d4fcf3913a0e07d5a57cade (diff) | |
| download | clang-3eea6350412eb7db13f0e2791c118920b36130a4.tar.gz clang-3eea6350412eb7db13f0e2791c118920b36130a4.tar.bz2 clang-3eea6350412eb7db13f0e2791c118920b36130a4.tar.xz | |
Don't assume that the LHS and RHS of a member pointer expression is a DeclRefExpr. Fixes PR5177.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83986 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/member-function-pointers.cpp')
| -rw-r--r-- | test/CodeGenCXX/member-function-pointers.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGenCXX/member-function-pointers.cpp b/test/CodeGenCXX/member-function-pointers.cpp index 9727a9dabd..13f7de5a63 100644 --- a/test/CodeGenCXX/member-function-pointers.cpp +++ b/test/CodeGenCXX/member-function-pointers.cpp @@ -54,3 +54,20 @@ void f3(A *a, A &ar) { (a->*pa)(); (ar.*pa)(); } + +// PR5177 +namespace PR5177 { + struct A { + bool foo(int*) const; + } a; + + struct B1 { + bool (A::*pmf)(int*) const; + const A* pa; + + B1() : pmf(&A::foo), pa(&a) {} + bool operator()() const { return (pa->*pmf)(new int); } + }; + + void bar(B1 b2) { while (b2()) ; } +} |
