1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 template <class T
> T
* f(int); // #1
4 template <class T
, class U
> T
& f(U
); // #2
7 int *ip
= f
<int>(1); // calls #1
16 T
* f2(int, typename identity
<T
>::type
= 0);
17 template <class T
, class U
>
18 T
& f2(U
, typename identity
<T
>::type
= 0);
24 template<class T
, class U
> struct A
{ };
26 template<class T
, class U
> inline int *f3( U
, A
<U
,T
>* p
= 0 ); // #1 expected-note{{candidate function [with T = int, U = int]}}
27 template< class U
> inline float *f3( U
, A
<U
,U
>* p
= 0 ); // #2 expected-note{{candidate function [with U = int]}}
30 float *fp
= f3
<int>( 42, (A
<int,int>*)0 ); // Ok, picks #2.
31 f3
<int>( 42 ); // expected-error{{call to 'f3' is ambiguous}}
38 int &f(char const* name
, Get fget
, char const* docstr
= 0);
40 template <class Get
, class Set
>
41 float &f(char const* name
, Get fget
, Set fset
, char const* docstr
= 0);
45 int &ir
= x
.f("blah", 0, "blah");