This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

g++ typedef bug


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]