Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / decl5.C
blobf8c447c01d3b768ad5451d820b8ba4ef70082503
1 // { dg-do assemble  }
3 // Copyright (C) 1999, 2000, 2002, 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
10 struct A {
11   int A::fn();        // { dg-warning "" } extra qualification
12   int A::m;           // { dg-warning "" } extra qualification
13   struct e;
14   struct A::e {int i;}; // { dg-warning "" } extra qualification
15   struct A::expand {  // { dg-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);  // { dg-warning "" } extra qualification
24 struct Q;
25 struct B {
26   struct A::fink {    // { dg-error "" } no such member
27   int m;
28   };
29   struct A::Z {       // { dg-error "" } A::Z not a member of B
30     int m;
31   };
32   int m;
33   int n;
34   struct ::Q {        // { dg-error "" } ::Q not a member of B
35     int m;
36   };
37   int A::fn() {       // { dg-error "" } A::fn not a member of B
38     return 0;
39   }
40   void fn(struct ::Q &);
41   void foo(struct A::y);  // { dg-error "" } no such member
44 struct ::C {          // { dg-warning "" } extra qualification
45   int i;
48 namespace N {
49   int fn();
50   struct F;
53 namespace NMS
55   void NMS::fn();     // { dg-warning "" "" } extra qualification
56   int NMS::i;         // { dg-warning "" "" } extra qualification
57   struct NMS::D {     // { dg-warning "" } extra qualification
58     int i;
59   };
60   struct N::E {       // { dg-error "" } no such type
61     int i;
62   };
63   struct ::F {        // { dg-error "" } no such type
64     int i;
65   };
66   int N::fn() {       // { dg-error "" } N::fn not a member of NMS
67     return 0;
68   }
69   struct N::F {       // { dg-error "" } N::F not a member of NMS
70     int i;
71   };
74 NMS::D thing;
75 void NMS::fn()
77   i = 3;