Add another test for [temp.func.order]p5/[temp.deduct.partial]p11,

from James Widman.

llvm-svn: 123245
This commit is contained in:
Douglas Gregor 2011-01-11 17:51:55 +00:00
parent b837ea4eee
commit 552c7cf22c
1 changed files with 11 additions and 0 deletions

View File

@ -20,3 +20,14 @@ template <class T, class U>
void g2() {
int* ip = f2<int>(1);
}
template<class T, class U> struct A { };
template<class T, class U> inline int *f3( U, A<U,T>* p = 0 ); // #1 expected-note{{candidate function [with T = int, U = int]}}
template< class U> inline float *f3( U, A<U,U>* p = 0 ); // #2 expected-note{{candidate function [with U = int]}}
void g3() {
float *fp = f3<int>( 42, (A<int,int>*)0 ); // Ok, picks #2.
f3<int>( 42 ); // expected-error{{call to 'f3' is ambiguous}}
}