https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121428
Bug ID: 121428
Summary: extern and member function definitions
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mpolacek at gcc dot gnu.org
Target Milestone: ---
We should reject the following due to [dcl.stc]/5: The extern specifier shall
be applied only to the declaration of a variable or function.
The extern specifier shall not be used in the declaration of a class member or
function parameter.
```
class X {
public:
void mf();
};
extern void X::mf()
{
}
int main()
{
X x;
x.mf();
}
```