------- Comment #10 from karx11erx at hotmail dot com 2008-06-20 12:33 ------- (In reply to comment #9) > (In reply to comment #8) > > > Because gcc 4.1 throws some errors on our > > > code that works flawlessly with MS compilers and gcc 3, and that > > > absolutely do > > > not seem to be justified, and I wanted to make sure this problem is > > > either > > > fixed or still present in the latest gcc release in order to avoid > > > remarks like > > > "update to the latest compiler version". > > > > Have you read the changes pages? > > Start with http://gcc.gnu.org/gcc-3.4/changes.html and then read > > http://gcc.gnu.org/gcc-4.0/changes.html and then > > http://gcc.gnu.org/gcc-4.1/changes.html . Most likely your C++ code is not > > really standard C++ after all. > > > > Which rule is forbidding this: > > template <class T> class CTest { > struct test { > int i; > } test *testptr; > }; >
(In reply to comment #8) > > Because gcc 4.1 throws some errors on our > > code that works flawlessly with MS compilers and gcc 3, and that absolutely > > do > > not seem to be justified, and I wanted to make sure this problem is either > > fixed or still present in the latest gcc release in order to avoid remarks > > like > > "update to the latest compiler version". > > Have you read the changes pages? > Start with http://gcc.gnu.org/gcc-3.4/changes.html and then read > http://gcc.gnu.org/gcc-4.0/changes.html and then > http://gcc.gnu.org/gcc-4.1/changes.html . Most likely your C++ code is not > really standard C++ after all. > There is also no ambiguity in this: template<class T> CBase<T> { protected: T *i; }; template<class T> CDerived : public CBase<T> { inline T* foo (void) { return const_cast <T*> i; } } Yet it only compiles if it is defined like this: template<class T> CDerived : public CBase<T> { inline T* foo (void) { return const_cast<T*> this->i; } } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36576