1 // RUN: clang -fsyntax-only -verify %s 2 void f(); 3 void f(int); 4 void f(int, float); 5 void f(int, int); 6 void f(int, ...); 7 8 typedef float Float; 9 void f(int, Float); // expected-error {{error: previous declaration is here}} 10 11 int f(int, Float); // expected-error {{error: functions that differ only in their return type cannot be overloaded}} 12 13 void g(void); // expected-error {{error: previous declaration is here}} 14 int g(); // expected-error {{error: functions that differ only in their return type cannot be overloaded}} 15 16 class X { 17 void f(); 18 void f(int); 19 void f() const; 20 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 }; 28