| 1 |
// { dg-do assemble } |
| 2 |
// Message-Id: <[email protected]> |
| 3 |
// Date: Wed, 4 Mar 92 12:50 MET |
| 4 |
// From: [email protected] (Niklas Hallqvist) |
| 5 |
// To: [email protected], [email protected] |
| 6 |
// Cc: [email protected] |
| 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; |