egcs 1.0.1 internal compiler error 9

Mark Mitchell mmitchell@usa.net
Tue Feb 10 23:55:00 GMT 1998


>>>>> "David" == David Rourke <rourke@waugh.cchem.berkeley.edu> writes:

    David> Given the following code:

    David> foo2.cc ------- // Deliberately leave out forward
    David> declarations // // template<class T> class foo; //
    David> template<class T> T getx(const foo<T> &);

    David> template<class T> class foo { private: T x; public: void
    David> setx(T y); friend T getx <T>(const foo<T> &); };

    David> template<class T> T getx(const foo<T> &f) {return f.x;}
    David> template<class T> void foo<T>::setx(T y) {x=y;}

    David> int main() { foo<int> f; f.setx(3); int y=getx(f); return
    David> 0; }

This works fine with recent development snapshots.

-- 
Mark Mitchell		mmitchell@usa.net
Stanford University	http://www.stanford.edu




More information about the Gcc-bugs mailing list