From: Douglas Gregor Date: Wed, 12 Jan 2011 22:04:05 +0000 (+0000) Subject: Add some more partial-ordering tests, including one that changes with X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac6c09917eaf32a35d2c7c95856864d877ef1963;p=clang Add some more partial-ordering tests, including one that changes with the proposed resolution to core isue 692. I'm not certain which way we'll go on this one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123331 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CXX/temp/temp.decls/temp.variadic/partial-ordering.cpp b/test/CXX/temp/temp.decls/temp.variadic/partial-ordering.cpp index 2e85c18fff..e17c88d178 100644 --- a/test/CXX/temp/temp.decls/temp.variadic/partial-ordering.cpp +++ b/test/CXX/temp/temp.decls/temp.variadic/partial-ordering.cpp @@ -28,3 +28,36 @@ int check1[X1>::value == 2? 1 : -1]; int check2[X1>::value == 1? 1 : -1]; int check3[X1>::value == 2? 1 : -1]; int check4[X1>::value == 3? 1 : -1]; + +// Partial ordering of function templates. +template +int &f0(T1, T2, Rest...); // expected-note{{candidate function [with T1 = int, T2 = double, Rest = <>]}} + +template +float &f0(T1, T2); // expected-note{{candidate function [with T1 = int, T2 = double]}} + +// FIXME: this is currently ambiguous, based on the proposed resolution +// to core issue 692. +void test_f0() { + int &ir1 = f0(1, 2.0, 'a'); + float &fr1 = f0(1, 2.0); // expected-error{{call to 'f0' is ambiguous}} +} + +template +int &f1(T1, T2, Rest...); + +template +float &f1(T1, T2, ...); + +void test_f1() { + int &ir1 = f1(1, 2.0, 'a'); +} + +template +int &f2(T1, T2, Rest...); + +float &f2(...); + +void test_f2() { + int &ir1 = f2(1, 2.0, 'a'); +}