Open
Description
Consider this class:
struct s {
void f() {}
};
In a non-module world, f
is implicitly inline
, and writing the keyword is redundant.
But C++20 adopted P1779, which changes the semantics of this code: when s
is not attached to the global module, f
is not inline
; if you want it to be, you have to say so explicitly. This does not apply to defaulted member functions however:
struct s {
inline s() = default; // Still redundant.
};
So I believe this check should not trigger on non-defaulted functions outside the global module. (We may even want to add a check like modernize-modules
that adds inline
to ease the transition to modules.)
Godbolt: https://godbolt.org/z/Gv9YGzq9e