]> granicus.if.org Git - clang/commitdiff
Add another test for [temp.func.order]p5/[temp.deduct.partial]p11,
authorDouglas Gregor <dgregor@apple.com>
Tue, 11 Jan 2011 17:51:55 +0000 (17:51 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 11 Jan 2011 17:51:55 +0000 (17:51 +0000)
from James Widman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123245 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp

index ae9c083112ddd7564c7bea273927b870ba7ac99c..5aabebae94fc6785d496a2c322b1920e580ab925 100644 (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}}
+   
+}