This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++ 2.95 Sun,HP: problem with forward-declared nested derived class , template
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: g++ 2.95 Sun,HP: problem with forward-declared nested derived class , template
- From: catfind at csis dot hku dot hk
- Date: Fri, 12 Nov 1999 10:43:34 +0800 (HKT)
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.