Problem with inheriting from partial specialization
Andrew Pinski
pinskia@physics.uc.edu
Tue Sep 12 19:13:00 GMT 2006
>
> Dear gcc-bugs-mailinglist,
>
> I'm having a problem with inheriting from a partial specialization of
> a class, and in particular using a public templatized instance
> variable of the partial specialization. I've genericized the code with
> somebody else to the following reduction which shows the essence of
> the problem.
>
>
> template <typename I, typename O>
> class B {
> public:
> char x;
> };
>
> template <typename O>
> class B<O, void> {
> public:
> char x;
> };
>
> template <typename O>
> class C : public B<O, void> {
> public:
> void function() {
> printf("%c", x);
You need either B::x or this->x to make the access of x as dependent.
Please also read http://gcc.gnu.org/gcc-3.4/changes.html which talks about this and many
other changes that might affect your code.
And maybe http://gcc.gnu.org/gcc-4.0/changes.html
and http://gcc.gnu.org/gcc-4.1/changes.html
Thanks,
Andrew Pinski
More information about the Gcc-bugs
mailing list