I get a compile error "Internal Error: Segmentation Fault", at this line, where i define: template<class ValueType> class ArrayListImpl<ValueType>::Itr : public Iterator<ValueType> { } Previoulsy i define: template<class ValueType> class ArrayListImpl : public List<ValueType>::Impl{ private class Impl; .....[other stuff] }
Read <http://gcc.gnu.org/bugs.html>, we do not want just a snip of your code.
correction I get a compile error "Internal Error: Segmentation Fault", at this line, where i define: template<class ValueType> class ArrayListImpl<ValueType>::Itr : public Iterator<ValueType> { } Previoulsy i define: template<class ValueType> class ArrayListImpl : public List<ValueType>::Impl{ private class Itr; .....[other stuff] }
That's not what Andrew meant. We need a complete testcase which we can try to compile. Leaving out stuff with "//...more stuff" is not sufficient. Please read the page Andrew pointed you to to see what kind of information we need (read the section on preprocessed sources). Thanks Wolfgang
template<class ValueType = Object> class ArrayListImpl : public List<ValueType>::Impl { private: class Itr; private: Array<ValueType> elemData; private: _index numElems; protected: static _index DEFAULT_CAPACITY; //LINUX public: ArrayListImpl( _index pInitialCapacity =DEFAULT_CAPACITY ); public: ArrayListImpl( const ArrayListImpl& pAnother ); public: ArrayListImpl& operator =( const ArrayListImpl& pAnother ); friend class Itr; }; /******************I GET AN ERROR IN THE FOLLOWING LINE#: *****/ template<class ValueType> class ArrayListImpl<ValueType>::Itr : public Iterator<ValueType> { private: class Impl : public Iterator<ValueType>::Impl { protected: ArrayListImpl<ValueType>& base; private: index cursor; private: int lastRet; private: boolean canRemove; protected: Impl( ArrayListImpl<ValueType>& pBase ); protected: Impl( const ArrayListImpl<ValueType>& pBase ); protected: Impl( const Impl& pAnother ); protected: ~Impl(); private: Impl& operator =( const Impl& pAnother ); friend class Itr; }; public: Itr( Impl* pImpl ); };
You still are not getting the point the code you gave will not work on any compiler as where is List defined and other classes. From http://gcc.gnu.org/bugs: What we need (all of these are needed) Please include in your bug report all of the following items, the first three of which can be obtained from the output of gcc -v: the exact version of GCC; the system type; the options given when GCC was configured/built; the complete command line that triggers the bug; the compiler output (error messages, warnings, etc.); and the preprocessed file (*.i*) that triggers the bug, generated by adding -save-temps to the complete compilation command, or, in the case of a bug report for the GNAT front end, a complete set of source files (see below). What we do not want:(this is what you gave us so far.) A code snippet that won't cause the compiler to produce the exact output mentioned in the bug report (e.g., a snippet with just a few lines around the one that apparently triggers the bug, with some pieces replaced with ellipses or comments for extra obfuscation :-) Bugs in releases or snapshots of GCC not issued by the GNU Project. Report them to whoever provided you with the release
2.96 is a non-supported version, also there has been many releases since 2000. 3.3.1 is the lastest, 3.3.2 will be released next month. Closing as there is no way to reproduce this without a testcase but I would try a newer GCC first any way.