qualified-id-lookup.cpp revision a67865c64e2185817703b602ec24163b286abaab
1// RUN: clang -fsyntax-only -verify %s
2
3namespace Ns {
4  int f(); // expected-note{{previous declaration is here}}
5}
6namespace Ns {
7  double f(); // expected-error{{functions that differ only in their return type cannot be overloaded}}
8}
9
10namespace Ns2 {
11  float f();
12}
13
14namespace Ns2 {
15  float f(int); // expected-note{{previous declaration is here}}
16}
17
18namespace Ns2 {
19  double f(int); // expected-error{{functions that differ only in their return type cannot be overloaded}}
20}
21
22namespace N {
23  int& f1();
24}
25
26namespace N {
27  struct f1 {
28    static int member;
29  };
30
31  void test_f1() {
32    int &i1 = f1();
33  }
34}
35
36namespace N {
37  float& f1(int);
38
39  struct f2 {
40    static int member;
41  };
42  void f2();
43}
44
45int i1 = N::f1::member;
46typedef struct N::f1 type1;
47int i2 = N::f2::member;
48typedef struct N::f2 type2;
49
50void test_f1(int i) {
51  int &v1 = N::f1();
52  float &v2 = N::f1(i);
53  int v3 = ::i1;
54}
55
56