https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93625
Bug ID: 93625
Summary: inline specifier in a friend function declaration
Product: gcc
Version: 9.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: the1987.6 at gmail dot com
Target Milestone: ---
In the latest working draft N4849,
9.2.7 The inline specifier
"If the inline specifier is used in a friend function declaration, that
declaration shall be a definition or the function shall have previously been
declared inline."
But no error has been occurred by the following code.
---------------
struct X{
friend inline void f();
};
void f(){}
-------
The declaration of f as inline, is not a definition.
Also there is not a previous declaration as inline.
This seems like a compiler bug.
By the way, there is the rule in N1638(published April 11, 2004).