Hans Wennborg | 701d1e7 | 2011-07-12 08:45:31 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | // PR10283 |
Kaelyn Uhrain | f0c1d8f | 2011-08-03 20:36:05 +0000 | [diff] [blame] | 4 | void min(); //expected-note {{'min' declared here}} |
Hans Wennborg | 701d1e7 | 2011-07-12 08:45:31 +0000 | [diff] [blame] | 5 | void min(int); |
| 6 | |
Kaelyn Uhrain | f0c1d8f | 2011-08-03 20:36:05 +0000 | [diff] [blame] | 7 | template <typename T> void max(T); //expected-note {{'max' declared here}} |
Hans Wennborg | 701d1e7 | 2011-07-12 08:45:31 +0000 | [diff] [blame] | 8 | |
| 9 | void f() { |
| 10 | fin(); //expected-error {{use of undeclared identifier 'fin'; did you mean 'min'}} |
| 11 | fax(0); //expected-error {{use of undeclared identifier 'fax'; did you mean 'max'}} |
| 12 | } |
Kaelyn Uhrain | 844d572 | 2011-08-04 23:30:54 +0000 | [diff] [blame^] | 13 | |
| 14 | // TODO: Add proper function overloading resolution for template functions |
| 15 | template <typename T> void somefunc(T*, T*); |
| 16 | template <typename T> void somefunc(const T[]); |
| 17 | template <typename T1, typename T2> void somefunc(T1*, T2*); |
| 18 | template <typename T1, typename T2> void somefunc(T1*, const T2[]); //expected-note 5 {{'somefunc' declared here}} \ |
| 19 | //expected-note {{candidate function template not viable: requires 2 arguments, but 1 was provided}} TODO this shouldn't happen |
| 20 | |
| 21 | void c() { |
| 22 | int *i = 0, *j = 0; |
| 23 | const int x[] = {1, 2, 3}; |
| 24 | long *l = 0; |
| 25 | somefun(i, j); //expected-error {{use of undeclared identifier 'somefun'; did you mean 'somefunc'?}} |
| 26 | somefun(x); //expected-error {{use of undeclared identifier 'somefun'; did you mean 'somefunc'?}} \ |
| 27 | //expected-error {{no matching function for call to 'somefunc'}} TODO this shouldn't happen |
| 28 | somefun(i, l); //expected-error {{use of undeclared identifier 'somefun'; did you mean 'somefunc'?}} |
| 29 | somefun(l, x); //expected-error {{use of undeclared identifier 'somefun'; did you mean 'somefunc'?}} |
| 30 | somefun(i, x); //expected-error {{use of undeclared identifier 'somefun'; did you mean 'somefunc'?}} |
| 31 | } |