From b7c36f6c681f22c413b5e27d1aeeeaff80889f76 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sat, 21 May 2011 21:04:55 +0000 Subject: Classify bound member function types are member function types. Fixes PR9973 / . llvm-svn: 131810 --- clang/test/SemaCXX/member-pointer.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'clang/test/SemaCXX/member-pointer.cpp') 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::test0b(); // expected-note {{in instantiation}} } + +namespace PR9973 { + template struct dm + { + typedef R T::*F; + F f_; + template int & call(U u) + { return u->*f_; } // expected-error{{non-const lvalue reference to type 'int' cannot bind to a temporary of type ''}} + + template int operator()(U u) + { call(u); } // expected-note{{in instantiation of}} + }; + + template + dm mem_fn(R T::*) ; + + struct test + { int nullary_v(); }; + + void f() + { + test* t; + mem_fn(&test::nullary_v)(t); // expected-note{{in instantiation of}} + } +} -- cgit v1.2.3