...when the function declaration's return type is already invalid for
some reason. This is relevant to https://github.com/llvm/llvm-project/issues/49188
because another way that the declaration's return type could become
invalid is that it might be C auto where C<void> is false.
(This doesn't actually fix 49188, but it eliminates a surprising redundant warning in the fix I tried, and also eliminates redundant warnings in the test cases depicted here.)
The comment in the test helped me understand this case better. I'd find "(The intended return type may have been void)" a useful hint here.