blob: ae85ff45353d7c99181a09ed2f490dba321cb4ec [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Douglas Gregor6cbd3df2008-10-24 18:09:54 +00002
3// PR2942
4typedef void fn(int);
Chris Lattner5f4a6822008-11-23 23:12:31 +00005fn f; // expected-note {{previous declaration is here}}
Douglas Gregor3dda64e2008-10-27 12:50:38 +00006
7int g(int x, int y);
8int g(int x, int y = 2);
9
10typedef int g_type(int, int);
11g_type g;
12
Chris Lattner5f4a6822008-11-23 23:12:31 +000013int h(int x) { // expected-note {{previous definition is here}}
Douglas Gregor3dda64e2008-10-27 12:50:38 +000014 return g(x);
15}
Douglas Gregor6fc17ff2008-10-29 15:10:40 +000016
17float f(int) { } // expected-error{{functions that differ only in their return type cannot be overloaded}}
18
19int h(int) { } // expected-error{{redefinition of 'h'}}
20