1 // { dg-do assemble  }
2 // Message-Id: <m0lLuUK-0000fRC@nix.appli.se>
3 // Date: Wed, 4 Mar 92 12:50 MET
4 // From: niklas@appli.se (Niklas Hallqvist)
5 // To: eichin@cygnus.com, tiemann@cygnus.com
6 // Cc: gcc2@cygnus.com
7 // Subject: nested type handling
8 //
9 // The last couple of days I've been struggling with nested types in the
10 // C++ compiler.  Frankly, it's a mess!  Was it impossible to put the stuff
11 // into the parser instead of the lexer?  Well, anyway, to get the following
12 // code to compile:
13 //
14 // struct O {
15 //   struct M {
16 //     struct I
17 //       {};
18 //   };
19 // };
20 // O::M::I s;
21 //
22 // a patch enclosed below is needed.  I'm not sure if it causes any
23 // unanticipated side-effects, but it seem to work well for me.
24 
25 
26 struct O {
27   struct M {
28     struct I
29       {};
30   };
31 };
32 O::M::I s;
33