// RUN: clang-cc -fsyntax-only -verify %s

struct X {
  template<typename T> T& f0(T);
  
  void g0(int i, double d) {
    int &ir = f0(i);
    double &dr = f0(d);
  }
  
  template<typename T> T& f1(T);
  template<typename T, typename U> U& f1(T, U);
  
  void g1(int i, double d) {
    int &ir1 = f1(i);
    int &ir2 = f1(d, i);
    int &ir3 = f1(i, i);
  }
};

void test_X_f0(X x, int i, float f) {
  int &ir = x.f0(i);
  float &fr = x.f0(f);
}

void test_X_f1(X x, int i, float f) {
  int &ir1 = x.f1(i);
  int &ir2 = x.f1(f, i);
  int &ir3 = x.f1(i, i);
}

void test_X_f0_address() {
  int& (X::*pm1)(int) = &X::f0;
  float& (X::*pm2)(float) = &X::f0;
}

void test_X_f1_address() {
  int& (X::*pm1)(int) = &X::f1;
  float& (X::*pm2)(float) = &X::f1;
  int& (X::*pm3)(float, int) = &X::f1;
}

// RUN: clang-cc -fsyntax-only -verify %s

struct X {
  template<typename T> T& f0(T);
  
  void g0(int i, double d) {
    int &ir = f0(i);
    double &dr = f0(d);
  }
  
  template<typename T> T& f1(T);
  template<typename T, typename U> U& f1(T, U);
  
  void g1(int i, double d) {
    int &ir1 = f1(i);
    int &ir2 = f1(d, i);
    int &ir3 = f1(i, i);
  }
};

void test_X_f0(X x, int i, float f) {
  int &ir = x.f0(i);
  float &fr = x.f0(f);
}

void test_X_f1(X x, int i, float f) {
  int &ir1 = x.f1(i);
  int &ir2 = x.f1(f, i);
  int &ir3 = x.f1(i, i);
}

--- 
+++ 
@@ -28,3 +28,14 @@
   int &ir2 = x.f1(f, i);
   int &ir3 = x.f1(i, i);
 }
+
+void test_X_f0_address() {
+  int& (X::*pm1)(int) = &X::f0;
+  float& (X::*pm2)(float) = &X::f0;
+}
+
+void test_X_f1_address() {
+  int& (X::*pm1)(int) = &X::f1;
+  float& (X::*pm2)(float) = &X::f1;
+  int& (X::*pm3)(float, int) = &X::f1;
+}
Add test taking the address of a member function template and converting it to a member pointer.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@79699 91177308-0d34-0410-b5e6-96231b3b80d8
