https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86208
Bug ID: 86208
Summary: improper handling of an extern declared inline
function
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: zhonghao at pku dot org.cn
Target Milestone: ---
The code is as follow:
class X {
public:
int i;
};
inline const int& OHashKey(const X& x) {
return x.i;
}
int main() {
extern const int& OHashKey(const X& x);
X x;
return OHashKey(x);
}
It comes from a previous bug report
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3698).
It says that g++3.0 produces a error message when compiling the code:
undefined reference to `OHashKey(X const&)'
I tried the latest g++, and it still produces the identical error message.
Is this a recurring bug?