On Dec 8, 2004, at 4:23 PM, Stephane Ouellette wrote:

Folks,

I am pretty new at compiling GCC, so I would like to know if anyone has ever seen something like this. The attached program compiles cleanly under g++ 3.3.2 but fails to compile under g++ 3.4.2 and 3.4.3.

Did you read the changes page for 3.4.x?

Your code is invalid C++.
Do the following instead:
template<class T>
class DerivedClassThatDoesNotWork : public MiddleClass<T>
{
 public:
  DerivedClassThatDoesNotWork(int x, T y) : MiddleClass<T>(x, y)
    {
      this->V = 5;
          /* or this: */
          MiddleClass<T>::V = 5;
    }
};


Thanks, Andrew Pinski



Reply via email to