OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.brendan/] [nest18.C] - Blame information for rev 305

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// GROUPS passed nested-classes
3
// This is the first line of file ||t2.C||.
4
 
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.
9
 
10
// If this class does not precede String, then the code will compile.
11
 
12
class Another {
13
public:
14
    typedef int Length;
15
};
16
 
17
// If String does not define typedef int Length, then the code will
18
// compile.
19
 
20
class String {
21
public:
22
    typedef int Length;         // remove this and it will compile fine
23
 
24
    int foo(Length length) const;
25
};
26
 
27
int String::foo(Length length) const {
28
    return length;
29
}
30
 
31
// File ||t2.C|| ends here.

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.