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]

[comp.lang.c++.moderated] Incomplete type problem


Hi!

I saw this in comp.lang.c++.moderated, and was about to say that the
current snapshot of egcs would compile it if he'd used typename C::B
instead of just C::B, when I decided to try it.  It produced an
internal compiler error in line 7 :-(

It seems that lookup_field should not look at D's base class until it
is defined...  Does anyone have a simple fix?

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil


Why does the following code produce an incomplete type? I struggled hard
through the CD2 to find the reason, but did not find the spot. Could it
be a
compiler error? If not, what could be done to achieve this desired
functionality?

template<class C>
class A {
public:
  C::B x;
};

class D : public A<D> {
public:
  typedef double B;
};

Regards,
	Axel Thimm.
--
Axel Thimm   thimm@physik.fu-berlin.de thimm@ifh.de

      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]



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