g++ 2.95 Sun,HP: problem with forward-declared nested derived class , template
catfind@csis.hku.hk
catfind@csis.hku.hk
Tue Nov 30 23:39:00 GMT 1999
Hi,
> Two instances of the same problem: one on Solaris 2.6, one on HP-UX 10.20;
> both with gcc 2.95.1.
>
> If the nested class (B) is fully declared (rather than just forward
> declared) inside the "outer" class (A), it compiles correctly.
One more problem instance: the same problem is found
in g++ 2.95.2 on Solaris 2.7.
> 1 // problem with forward-declared nested derived class template
> 2
> 3 template <typename T>
> 4 class A
> 5 {
> 6 public:
> 7 class B;
> 8 };
> 9
> 10 template <typename T>
> 11 class A<T>::B : public T
> 12 {
> 13 };
By the way, if class A<T>::B is not derived from T (or something
like list<T> for that matter), things compile okay.
Regards,
Beta.
More information about the Gcc-bugs
mailing list