forked from OSchip/llvm-project
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. llvm-svn: 123331
This commit is contained in:
parent
58b6f4d832
commit
ab2ecacee1
|
@ -28,3 +28,36 @@ int check1[X1<tuple<int>>::value == 2? 1 : -1];
|
|||
int check2[X1<tuple<int, int>>::value == 1? 1 : -1];
|
||||
int check3[X1<tuple<int, int&>>::value == 2? 1 : -1];
|
||||
int check4[X1<tuple<int&, int&>>::value == 3? 1 : -1];
|
||||
|
||||
// Partial ordering of function templates.
|
||||
template<typename T1, typename T2, typename ...Rest>
|
||||
int &f0(T1, T2, Rest...); // expected-note{{candidate function [with T1 = int, T2 = double, Rest = <>]}}
|
||||
|
||||
template<typename T1, typename T2>
|
||||
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<typename T1, typename T2, typename ...Rest>
|
||||
int &f1(T1, T2, Rest...);
|
||||
|
||||
template<typename T1, typename T2>
|
||||
float &f1(T1, T2, ...);
|
||||
|
||||
void test_f1() {
|
||||
int &ir1 = f1(1, 2.0, 'a');
|
||||
}
|
||||
|
||||
template<typename T1, typename T2, typename ...Rest>
|
||||
int &f2(T1, T2, Rest...);
|
||||
|
||||
float &f2(...);
|
||||
|
||||
void test_f2() {
|
||||
int &ir1 = f2(1, 2.0, 'a');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue