[cfe-commits] r123245 - /cfe/trunk/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp

Douglas Gregor dgregor at apple.com
Tue Jan 11 09:51:55 PST 2011


Author: dgregor
Date: Tue Jan 11 11:51:55 2011
New Revision: 123245

URL: http://llvm.org/viewvc/llvm-project?rev=123245&view=rev
Log:
Add another test for [temp.func.order]p5/[temp.deduct.partial]p11,
from James Widman.

Modified:
    cfe/trunk/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp

Modified: cfe/trunk/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp?rev=123245&r1=123244&r2=123245&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp Tue Jan 11 11:51:55 2011
@@ -20,3 +20,14 @@
 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}}
+   
+}





More information about the cfe-commits mailing list