This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ typedef bug
- To: gcc-bugs at gcc dot gnu dot org
- Subject: g++ typedef bug
- From: Johnny Burlin <johnny at iar dot se>
- Date: Wed, 20 Sep 2000 17:20:55 +0200
Hi.
The following program generates an error:
#include <iostream>
struct A;
struct B {
typedef A C;
};
struct A {
struct E {};
};
struct D : public B::C::E {
};
int main(void) {
cout << endl;
return 0;
}
with the command line:
g++ test.cpp -o go
g++ says:
test.cpp:13 no type named 'A' in 'struct B'
Now, enter the line
typedef B::C::E F
and change line 13 to
struct D : public F {
and the program compiles.
It is not a very serious bug since there
is a easy workaround but it's annoying
that the original B::C::E does not work.
/Johnny