https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80458
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- The two cases are not equivalent, because the member function is also inline. If you add 'inline' to the second example you get no warning for that one too. In both cases you get a warning for the inline function if it is used.