2 // GROUPS passed nested-classes
3 // This is the first line of file ||t2.C||.
5 // This code demonstrates what appears to be a bug with nested types.
6 // In C++, nested typedefs are not supposed to be visible outside
7 // their class scopes but they apparently are in gcc 2.4.5. This code
8 // compiles fine in AT&T cfront 3.0.1, but will not compile with gcc.
10 // If this class does not precede String, then the code will compile.
17 // If String does not define typedef int Length, then the code will
22 typedef int Length; // remove this and it will compile fine
24 int foo(Length length) const;
27 int String::foo(Length length) const {
31 // File ||t2.C|| ends here.