https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66995
Bug ID: 66995
Summary: First declaration as inline after definition of
function
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: anders.granlund.0 at gmail dot com
Target Milestone: ---
Consider the following program (prog.cc):
void f() {}
inline void f();
int main() {}
It is ill-formed by [dcl.fct.spec]/4 (http://eel.is/c++draft/dcl.fct.spec#4):
"If the definition of a function appears in a translation unit before its first
declaration as inline, the program is ill-formed."
Therefore I expected gcc to give at least one diagnostic message when compiling
it, but I get none with the following command line:
g++ prog.cc -std=c++98 -pedantic-errors
I have tried with gcc HEAD 6.0.0 20150722 here:
http://melpon.org/wandbox/permlink/c6wrML22huCFZMxp