Beef up the test for function call operators slightly

llvm-svn: 59675
This commit is contained in:
Douglas Gregor 2008-11-19 22:59:19 +00:00
parent ab7897ac44
commit 20b300231a
1 changed files with 2 additions and 0 deletions

View File

@ -141,10 +141,12 @@ typedef float& Func2(int, double);
struct ConvertToFunc { struct ConvertToFunc {
operator Func1*(); // expected-note{{conversion candidate of type 'int &(*)(float, double)'}} operator Func1*(); // expected-note{{conversion candidate of type 'int &(*)(float, double)'}}
operator Func2&(); // expected-note{{conversion candidate of type 'float &(&)(int, double)'}} operator Func2&(); // expected-note{{conversion candidate of type 'float &(&)(int, double)'}}
void operator()();
}; };
void test_funcptr_call(ConvertToFunc ctf) { void test_funcptr_call(ConvertToFunc ctf) {
int &i1 = ctf(1.0f, 2.0); int &i1 = ctf(1.0f, 2.0);
float &f2 = ctf((short int)1, 1.0f); float &f2 = ctf((short int)1, 1.0f);
ctf((long int)17, 2.0); // expected-error{{error: call to object of type 'struct ConvertToFunc' is ambiguous; candidates are:}} ctf((long int)17, 2.0); // expected-error{{error: call to object of type 'struct ConvertToFunc' is ambiguous; candidates are:}}
ctf();
} }