aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/member-template-access-expr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-10-24 04:59:53 +0000
committerDouglas Gregor <dgregor@apple.com>2009-10-24 04:59:53 +0000
commit3eefb1c4bd2c562e43f25e0dba657bb32361dd14 (patch)
treedeb707e1fac14d534b44d44e0bf818f6f5088c03 /test/SemaTemplate/member-template-access-expr.cpp
parent4d0d85c3370f2726c74ba0ece0a5e712830a1d82 (diff)
Fix overload resolution when calling a member template or taking the
address of a member template when explicit template arguments are provided. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/member-template-access-expr.cpp')
-rw-r--r--test/SemaTemplate/member-template-access-expr.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/test/SemaTemplate/member-template-access-expr.cpp b/test/SemaTemplate/member-template-access-expr.cpp
index 0f9f21f339..feef7926fb 100644
--- a/test/SemaTemplate/member-template-access-expr.cpp
+++ b/test/SemaTemplate/member-template-access-expr.cpp
@@ -1,5 +1,4 @@
// RUN: clang-cc -fsyntax-only -verify %s
-
template<typename U, typename T>
U f0(T t) {
return t.template get<U>();
@@ -50,3 +49,29 @@ B<T>::destroy()
void do_destroy_B(B<int> b) {
b.destroy();
}
+
+struct X1 {
+ int* f1(int);
+ template<typename T> float* f1(T);
+
+ static int* f2(int);
+ template<typename T> static float* f2(T);
+};
+
+void test_X1(X1 x1) {
+ float *fp1 = x1.f1<>(17);
+ float *fp2 = x1.f1<int>(3.14);
+ int *ip1 = x1.f1(17);
+ float *ip2 = x1.f1(3.14);
+
+ float* (X1::*mf1)(int) = &X1::f1;
+ float* (X1::*mf2)(int) = &X1::f1<>;
+ float* (X1::*mf3)(float) = &X1::f1<float>;
+
+ float* (*fp3)(int) = &X1::f2;
+ float* (*fp4)(int) = &X1::f2<>;
+ float* (*fp5)(float) = &X1::f2<float>;
+ float* (*fp6)(int) = X1::f2;
+ float* (*fp7)(int) = X1::f2<>;
+ float* (*fp8)(float) = X1::f2<float>;
+}