This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
egcs doesn't respect nested types access rules.
- To: egcs-bugs at cygnus dot com
- Subject: egcs doesn't respect nested types access rules.
- From: Louidor Erez <s3824888 at techst02 dot technion dot ac dot il>
- Date: Sat, 3 Oct 1998 21:04:15 +0200 (IST)
First, I already sent this mail, but for some reason I didn't see
it on the mailing list, so I am resending it, and my apologies if it
is received twice.
Second, regarding my previous mail about the -pedantic incorrect error,
and the need for the typename keyword. I tried looking it up in the errata
for the third edition (the URL is:www.research.att.com/~bs/3rd_errata.html)
but didn't find it, however what you (Alexandre) said about specializing
vector seemed reasonable.
Third, I believe this is another bug in egcs-1.1b:
The following code compiled on my linux box without a diagnostic:
class Outer {
typedef int T;
class Inner {
public:
void f() {
T i; /* should produce a compilation error:
Outer::T is not accessible in Outer::Inner::f() */
}
};
public:
void g();
};
Reading specs from
/usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
Since T is a private type of Outer it cannot be accessed in Inner.
I don't know if anyone reported this bug already.
Hope this helps.
Erez.