https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77892
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2016-10-07 Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Without line-wrapping: struct S{friend void f(){}}; void f(); int main() { void f(); f(); } /tmp/cchVsieq.o: In function `main': /tmp/f.cc:8: undefined reference to `f()' collect2: error: ld returned 1 exit status The local redeclaration prevents the inline definition being emitted.