blob: 9b0d0e205e7fc145cf4ae8a34fc105395c5bb99e [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);
Douglas Gregor1ca50c32008-11-21 15:36:28 +000019 void f() const;
Douglas Gregor8e9bebd2008-10-21 16:13:35 +000020
21 void g(int); // expected-error {{error: previous declaration is here}}
22 void g(int, float); // expected-error {{error: previous declaration is here}}
23 int g(int, Float); // expected-error {{error: functions that differ only in their return type cannot be overloaded}}
24
25 static void g(float);
26 static void g(int); // expected-error {{error: static and non-static member functions with the same parameter types cannot be overloaded}}
27};