Bug#227518: g++-3.3: Doesn't find inherited inner class after template instantiation
retitle 227518 [fixed in 3.4] g++-3.3: Doesn't find inherited inner class after template instantiation
tags 227518 + upstream
tags 227518 + fixed-upstream
thanks
Alexander Motzkau writes:
> Package: g++-3.3
> Version: 1:3.3.2-4
> Severity: normal
>
> Compiling the following file using
>
> g++ -Wall -c test.cc
>
> gives the following errors:
>
> test.cc: In member function `void D::fun()':
> test.cc:32: error: parse error before `;' token
>
>
> # 1 "test.cc"
> # 1 "<built-in>"
> # 1 "<command line>"
> # 1 "test.cc"
> template<typename T>
> class A
> {
> public:
> typedef int X;
> public:
> A(int i, const int y = 0);
> };
>
> class B
> {
> public:
> B(const A<int> &z = 1);
> };
>
> class C
> {
> public:
> class X
> {
> public:
> X() {}
> };
> };
>
> class D : public C
> {
> public:
> void fun()
> {
> new B();
> new X();
> }
> };
>
>
> If D::fun() is changed into:
>
> X fun()
> {
> new B();
> return X();
> }
>
> I get:
>
> test.cc: In member function `C::X D::fun()':
> test.cc:32: error: `X' undeclared (first use this function)
> test.cc:32: error: (Each undeclared identifier is reported only once for each
> function it appears in.)
>
> The code above is the shortest showing this error I could come up with.
This warning is printed usign the gcc-snapshot package. Not sure, if
you used that ...
Reply to: