swlab35:39> cat Y.cpp // Following fails when compiled by g++-3.3.1 with: // g++ -O2 -fno-exceptions -Winline -Werror class Gin { public: Gin(); virtual ~Gin() {} void up() const; }; // Gin template<class T> class Kup { public: Kup(): _p(0) {} Kup(T p): _p(p) { if (_p) { _p->up(); } } T _p; }; // Kup class HCABase : public Gin { public: HCABase(); virtual ~HCABase(); }; /* HCABase */ class WQ { public: WQ(HCABase* h); virtual ~WQ(); Kup<HCABase*> _hca; }; // WQ WQ::WQ(HCABase* h) : _hca(h) { } // WQ::WQ swlab35:40> g++ -O2 -fno-exceptions -Winline -c -o /tmp/Y.o Y.cpp Y.cpp: In member function `WQ::WQ(HCABase*)': Y.cpp:16: warning: inlining failed in call to `Kup<T>::Kup(T) [with T = HCABase*]' Y.cpp:44: warning: called from here Y.cpp: In member function `WQ::WQ(HCABase*)': Y.cpp:16: warning: inlining failed in call to `Kup<T>::Kup(T) [with T = HCABase*]' Y.cpp:44: warning: called from here swlab35:41>
What target is this on, as I cannot reproduce it on i686-pc-linux-gnu or powerpc-apple-darwin?
(In reply to comment #1) > What target is this on, as I cannot reproduce it on i686-pc-linux-gnu or powerpc-apple-darwin? I hope this answers teh above: uname -a; arch Linux swlab35 2.6.2 #5 SMP Wed Feb 11 15:41:53 IST 2004 i686 i686 i386 GNU/Linux i686
This works for me on the released version of 3.3.3. This might have been a bug in your vender's gcc.