[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / SemaCXX / overload-decl.cpp
blob1201396996e75ff8af74cdef92fe0ad917e35fbb
1 // RUN: %clang_cc1 -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, ...);
8 typedef float Float;
9 void f(int, Float); // expected-note {{previous declaration is here}}
11 int f(int, Float); // expected-error {{functions that differ only in their return type cannot be overloaded}}
13 void g(void); // expected-note {{previous declaration is here}}
14 int g(); // expected-error {{functions that differ only in their return type cannot be overloaded}}
16 typedef int INT;
18 class X {
19 void f();
20 void f(int); // expected-note {{previous declaration is here}}
21 void f() const;
23 void f(INT); // expected-error{{cannot be redeclared}}
25 void g(int); // expected-note {{previous declaration is here}}
26 void g(int, float); // expected-note {{previous declaration is here}}
27 int g(int, Float); // expected-error {{functions that differ only in their return type cannot be overloaded}}
29 static void g(float); // expected-note {{previous declaration is here}}
30 static void g(int); // expected-error {{static and non-static member functions with the same parameter types cannot be overloaded}}
31 static void g(float); // expected-error {{class member cannot be redeclared}}
33 void h(); // expected-note {{previous declaration is here}}
34 void h() __restrict; // expected-error {{class member cannot be redeclared}}
37 int main() {} // expected-note {{previous definition is here}}
38 int main(int,char**) {} // expected-error {{conflicting types for 'main'}}