1 // Build don't link:
2
3 // Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 22 Apr 1999 <nathan@acm.org>
5 // derived from a bug report by <rch@larissa.sd.bi.ruhr-uni-bochum.de>
6 // http://gcc.gnu.org/ml/gcc-bugs/1999-04n/msg00631.html
7 // the code is wrong, but we fell over badly
8
9
10 struct A {
11 int A::fn(); // WARNING - extra qualification
12 int A::m; // WARNING - extra qualification
13 struct e;
14 struct A::e {int i;};
15 struct A::expand { // WARNING - extra qualification
16 int m;
17 };
18 struct Z;
19 expand me;
20 void foo(struct A::e);
21 void foo(struct A::z); // WARNING - extra qualification
22 };
23
24 struct Q;
25 struct B {
26 struct A::fink { // ERROR - no such member
27 int m;
28 };
29 struct A::Z { // ERROR - A::Z not a member of B
30 int m;
31 };
32 int m;
33 int n;
34 struct ::Q { // ERROR XFAIL - ::Q not a member of B
35 int m;
36 };
fnB37 int A::fn() { // ERROR XFAIL - A::fn not a member of B
38 return 0;
39 }
40 void fn(struct ::Q &);
41 void foo(struct A::y); // ERROR XFAIL - no such member
42 };
43
44 struct ::C { // WARNING XFAIL - extra qualification
45 int i;
46 };
47
48 namespace N {
49 int fn();
50 struct F;
51 }
52
53 namespace NMS
54 {
55 void NMS::fn(); // WARNING - extra qualification XFAIL
56 int NMS::i; // WARNING - extra qualification XFAIL
57 struct NMS::D { // WARNING - extra qualification XFAIL
58 int i;
59 };
60 struct N::E { // ERROR - no such type XFAIL
61 int i;
62 };
63 struct ::F { // ERROR - no such type XFAIL
64 int i;
65 };
fn()66 int N::fn() { // ERROR - N::fn not a member of NMS XFAIL
67 return 0;
68 }
69 struct N::F { // ERROR XFAIL - N::F not a member of NMS XFAIL
70 int i;
71 };
72 }
73
74 NMS::D thing;
fn()75 void NMS::fn()
76 {
77 i = 3;
78 }
79