Bug 20275 - Mandatory inlining of templetized class member fails for no reason
Summary: Mandatory inlining of templetized class member fails for no reason
Status: RESOLVED DUPLICATE of bug 14950
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.3
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-02 06:46 UTC by Yuri
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri 2005-03-02 06:46:50 UTC
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 ---
Comment 1 Andrew Pinski 2005-03-02 06:53:02 UTC
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 ***