Classify bound member function types are member function types. Fixes
PR9973 / <rdar://problem/9479191>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131810 91177308-0d34-0410-b5e6-96231b3b80d8
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 @@
 
   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}}
+  }
+}