diff options
author | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
commit | c49018d9cce52d8c9f34b44865ec3ba8e89a1488 (patch) | |
tree | c5e9e10bc189de0058aa763c47b9920a8351b7df /test/SemaCXX/member-pointer.cpp | |
parent | 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (diff) | |
download | FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.zip FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.tar.gz |
Vendor import of clang trunk r132879:
http://llvm.org/svn/llvm-project/cfe/trunk@132879
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}} + } +} |