According to C++ standard 7.1.2 (4): An inline function shall be defined in every translation unit in which it is used and shall have exactly the same definition in every case For the following code: --------- inline.cc --------- #include <stdio.h> inline void foo() { printf("Hey!\n"); } void bar() { foo(); } ---------- main.cc ---------- extern void foo(); int main() { foo(); return 0; } ---------- g++ -std=c++98 main.cc inline.cc creates a program and does not report any violation of the standard.
I think it also mentions in the same pargraph that this violation does not have to be diagnostic.
In fact it does. This is a hard bug to fix without all translation units aviable at compile time. So I am going to close as won't fix.