29 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3// PR102834void min(); //expected-note {{'min' declared here}}5void min(int);6 7template <typename T> void max(T); //expected-note {{'max' declared here}}8 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}13 14template <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}}18 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'?}}24 somefun(x); //expected-error {{use of undeclared identifier 'somefun'; did you mean 'somefunc'?}}25 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}29