blob: 872a180e96c62d54e1a3726c589cc458e10ac50b [file] [log] [blame]
Douglas Gregor8e9bebd2008-10-21 16:13:35 +00001// RUN: clang -fsyntax-only -verify %s
2void f();
3void f(int);
4void f(int, float);
5void f(int, int);
6void f(int, ...);
7
8typedef float Float;
9void f(int, Float); // expected-error {{error: previous declaration is here}}
10
11int f(int, Float); // expected-error {{error: functions that differ only in their return type cannot be overloaded}}
12
13void g(void); // expected-error {{error: previous declaration is here}}
14int g(); // expected-error {{error: functions that differ only in their return type cannot be overloaded}}
15
16class X {
17 void f();
18 void f(int);
19
20 // FIXME: can't test this until we can handle const methods.
21 // void f() const;
22
23 void g(int); // expected-error {{error: previous declaration is here}}
24 void g(int, float); // expected-error {{error: previous declaration is here}}
25 int g(int, Float); // expected-error {{error: functions that differ only in their return type cannot be overloaded}}
26
27 static void g(float);
28 static void g(int); // expected-error {{error: static and non-static member functions with the same parameter types cannot be overloaded}}
29};