diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-05-21 21:04:55 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-05-21 21:04:55 +0000 |
commit | b7c36f6c681f22c413b5e27d1aeeeaff80889f76 (patch) | |
tree | cdd56872bfbdad9e6001820d1cf6bd89d6f33175 /clang/test/SemaCXX/member-pointer.cpp | |
parent | 5ec65765e6c19c19f3d4a1ad4938e7ccf24177e1 (diff) | |
download | bcm5719-llvm-b7c36f6c681f22c413b5e27d1aeeeaff80889f76.tar.gz bcm5719-llvm-b7c36f6c681f22c413b5e27d1aeeeaff80889f76.zip |
Classify bound member function types are member function types. Fixes
PR9973 / <rdar://problem/9479191>.
llvm-svn: 131810
Diffstat (limited to 'clang/test/SemaCXX/member-pointer.cpp')
-rw-r--r-- | clang/test/SemaCXX/member-pointer.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/member-pointer.cpp b/clang/test/SemaCXX/member-pointer.cpp index 31c651a4ad5..de3b211acf5 100644 --- a/clang/test/SemaCXX/member-pointer.cpp +++ b/clang/test/SemaCXX/member-pointer.cpp @@ -271,3 +271,28 @@ namespace rdar8358512 { template void B<int>::test0b(); // expected-note {{in instantiation}} } + +namespace PR9973 { + template<class R, class T> struct dm + { + typedef R T::*F; + F f_; + template<class U> int & call(U u) + { return u->*f_; } // expected-error{{non-const lvalue reference to type 'int' cannot bind to a temporary of type '<bound member function type>'}} + + template<class U> int operator()(U u) + { call(u); } // expected-note{{in instantiation of}} + }; + + template<class R, class T> + dm<R, T> mem_fn(R T::*) ; + + struct test + { int nullary_v(); }; + + void f() + { + test* t; + mem_fn(&test::nullary_v)(t); // expected-note{{in instantiation of}} + } +} |