What's wrong with this class temlate's typedef?

Rob spamrefuse@yahoo.com
Wed Jul 23 09:22:00 GMT 2008


Hi,

The following code snippet is a stripped down version of what I use in my code.
Last time I compiled this code is several years ago......I tried to compile it again
today with GCC 4.3.0 (20080428), but now I get an error message:

--------------------------------------------------------
template <typename T = double, unsigned int d = 3> class A { };

template <typename T = double> class B : public A<T, 4> {
    typedef A<T, 3> A;
};

int main () { B<double> *object; };
--------------------------------------------------------


Error message:
   4: error: declaration of ‘typedef class A<T, 3u> B<T>::A’
   1: error: changes meaning of ‘A’ from ‘class A<T, 3u>’

Here, I could use class "A" as a substitute for "A<T,3>" only within the class B.
That used to work in the past. Is there a way to get this compiled again without
having to change all the class names in the typedef?

Thank you.

Rob.





More information about the Gcc-help mailing list