[PATCH] D107933: [clang] Expose unreachable fallthrough annotation warning
David Blaikie via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 13 14:44:32 PDT 2021
dblaikie added a comment.
In D107933#2944204 <https://reviews.llvm.org/D107933#2944204>, @aaron.ballman wrote:
> In D107933#2944135 <https://reviews.llvm.org/D107933#2944135>, @nathanchance wrote:
>
>> In D107933#2942430 <https://reviews.llvm.org/D107933#2942430>, @xbolva00 wrote:
>>
>>> Yes, something like that, plus I think you want put UnreachableCodeFallthrough into group UnreachableCode as well.
>>
>> So you would recommend adding it to `UnreachableCode` rather than `UnreachableCodeAggressive`?
>
> I would recommend adding it to `UnreachableCode` as I don't see this being a particularly aggressive unreachable warning. FWIW, I would be opposed to dropping the diagnostic entirely as the standard recommends diagnosing an unreachable fallthrough statement (https://eel.is/c++draft/dcl.attr.fallthrough#2.sentence-2 and the similar wording in C2x 6.7.11.5p3.
(totally not to derail this, but... - I'm not sure that wording in the spec is especially informative/worth worrying about too much. If we have a warning we know isn't especially informative and is off-by-default, I'm not sure it makes too much difference whether we have it all. The spec doesn't have a lot of practice spec'ing warnings, which have a bunch of nuance that the spec doesn't usually have to deal with)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107933/new/
https://reviews.llvm.org/D107933
More information about the cfe-commits
mailing list