blob: 8c5cec8af3a967673f649774e7bd0073e618b466 [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
Kaelyn Uhrainace5e762011-08-05 00:09:52 +000014template <typename T> void somefunc(T*, T*); //expected-note {{'somefunc' declared here}}
15template <typename T> void somefunc(const T[]); //expected-note {{'somefunc' declared here}}
16template <typename T1, typename T2> void somefunc(T1*, T2*); //expected-note {{'somefunc' declared here}}
17template <typename T1, typename T2> void somefunc(T1*, const T2[]); //expected-note 2 {{'somefunc' declared here}}
Kaelyn Uhrain844d5722011-08-04 23:30:54 +000018
19void c() {
20 int *i = 0, *j = 0;
21 const int x[] = {1, 2, 3};
22 long *l = 0;
23 somefun(i, j); //expected-error {{use of undeclared identifier 'somefun'; did you mean 'somefunc'?}}
Kaelyn Uhrainace5e762011-08-05 00:09:52 +000024 somefun(x); //expected-error {{use of undeclared identifier 'somefun'; did you mean 'somefunc'?}}
Kaelyn Uhrain844d5722011-08-04 23:30:54 +000025 somefun(i, l); //expected-error {{use of undeclared identifier 'somefun'; did you mean 'somefunc'?}}
26 somefun(l, x); //expected-error {{use of undeclared identifier 'somefun'; did you mean 'somefunc'?}}
27 somefun(i, x); //expected-error {{use of undeclared identifier 'somefun'; did you mean 'somefunc'?}}
28}