diff options
Diffstat (limited to 'test/SemaCXX/member-pointer.cpp')
-rw-r--r-- | test/SemaCXX/member-pointer.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/SemaCXX/member-pointer.cpp b/test/SemaCXX/member-pointer.cpp index 31c651a..de3b211 100644 --- a/test/SemaCXX/member-pointer.cpp +++ b/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}} + } +} |