From 4e97586b804f6132d83cb534f16a5b6a7756e819 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 11 Jan 2011 17:51:55 +0000 Subject: [PATCH] Add another test for [temp.func.order]p5/[temp.deduct.partial]p11, from James Widman. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123245 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../temp.deduct/temp.deduct.partial/p11.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp index ae9c083112..5aabebae94 100644 --- a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp +++ b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp @@ -20,3 +20,14 @@ template void g2() { int* ip = f2(1); } + +template struct A { }; + +template inline int *f3( U, A* p = 0 ); // #1 expected-note{{candidate function [with T = int, U = int]}} +template< class U> inline float *f3( U, A* p = 0 ); // #2 expected-note{{candidate function [with U = int]}} + +void g3() { + float *fp = f3( 42, (A*)0 ); // Ok, picks #2. + f3( 42 ); // expected-error{{call to 'f3' is ambiguous}} + +} -- 2.40.0