1 // RUN: %clang_cc1 -fsyntax-only -verify %s
4 template<typename T
> T
& f0(T
);
6 void g0(int i
, double d
) {
11 template<typename T
> T
& f1(T
);
12 template<typename T
, typename U
> U
& f1(T
, U
);
14 void g1(int i
, double d
) {
21 void test_X_f0(X x
, int i
, float f
) {
26 void test_X_f1(X x
, int i
, float f
) {
28 int &ir2
= x
.f1(f
, i
);
29 int &ir3
= x
.f1(i
, i
);
32 void test_X_f0_address() {
33 int& (X::*pm1
)(int) = &X::f0
;
34 float& (X::*pm2
)(float) = &X::f0
;
37 void test_X_f1_address() {
38 int& (X::*pm1
)(int) = &X::f1
;
39 float& (X::*pm2
)(float) = &X::f1
;
40 int& (X::*pm3
)(float, int) = &X::f1
;
43 void test_X_f0_explicit(X x
, int i
, long l
) {
44 int &ir1
= x
.f0
<int>(i
);
46 long &il1
= x
.f0
<long>(i
);
50 class A
{ template <class x
> x
a(x z
) { return z
+y
; } int y
; };
55 bool operator()(const T
& v
) const {
60 void test_Functor(Functor f
) {
64 // Instantiation on ->
67 template<typename U
> U
& get();
70 template<typename T
> struct X2
; // expected-note{{here}}
72 void test_incomplete_access(X1
<int> *x1
, X2
<int> *x2
) {
73 float &fr
= x1
->get
<float>();
74 (void)x2
->get
<float>(); // expected-error{{implicit instantiation of undefined template}}
77 // Instantiation of template template parameters in a member function
80 template<int Dim
> struct X
{
81 template<template<class> class M
, class T
> void f(const M
<T
>&);
84 template<typename T
> struct Y
{ };
86 void test_f(X
<3> x
, Y
<int> y
) { x
.f(y
); }
90 template <typename T
> struct X
{};
92 template <typename T1
> struct S
{
93 template <template <typename
> class TC
> void foo(const TC
<T1
>& arg
);
96 template <typename T1
> template <template <typename
> class TC
>
97 void S
<T1
>::foo(const TC
<T1
>& arg
) {}
99 void test(const X
<int>& x
) {