blob: a0f70dfbdb9c10a04d543e83acbdde8a0ca604c1 [file] [log] [blame]
Hans Wennborg701d1e72011-07-12 08:45:31 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3// PR10283
Kaelyn Uhrainf0c1d8f2011-08-03 20:36:05 +00004void min(); //expected-note {{'min' declared here}}
Hans Wennborg701d1e72011-07-12 08:45:31 +00005void min(int);
6
Kaelyn Uhrainf0c1d8f2011-08-03 20:36:05 +00007template <typename T> void max(T); //expected-note {{'max' declared here}}
Hans Wennborg701d1e72011-07-12 08:45:31 +00008
9void 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 Uhrain844d5722011-08-04 23:30:54 +000013
14// TODO: Add proper function overloading resolution for template functions
15template <typename T> void somefunc(T*, T*);
16template <typename T> void somefunc(const T[]);
17template <typename T1, typename T2> void somefunc(T1*, T2*);
18template <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
21void 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}