Compiling following code get error below. Once I remove template<> from class R it inlines fine. Yuri --- begin code --- #define inline __attribute__ ((__always_inline__)) template<class T> struct R { inline void R::r(int& c); }; template<class T> inline void R<T>::r(int& c) { } class BB {}; void fffff(R<BB> *rr) { int i; rr->r(i); } --- end code --- --- begin error --- i.C: In function `void fffff(R<BB>*)': i.C:6: sorry, unimplemented: inlining failed in call to 'void R<T>::r(int&) [with T = BB]': function not inlinable i.C:11: sorry, unimplemented: called from here i.C: In function `void fffff(R<BB>*)': i.C:6: sorry, unimplemented: inlining failed in call to 'void R<T>::r(int&) [with T = BB]': function not inlinable i.C:11: sorry, unimplemented: called from here --- end error ---
Yes there is a reason, this is just a bug in gcc :). In fact a regression from 3.3.x. But is fixed already in 4.0.0. This is a dup of bug 14950. *** This bug has been marked as a duplicate of 14950 ***