https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80458
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- I think this is because an unused inline function doesn't generate any code, so isn't seen by the compiler passes that produce the warning.