[PATCH] D73852: [clang] detect switch fallthrough marked by a comment (PR43465)
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 2 14:12:08 PST 2020
rsmith added a comment.
In D73852#1901699 <https://reviews.llvm.org/D73852#1901699>, @llunak wrote:
> In D73852#1901186 <https://reviews.llvm.org/D73852#1901186>, @rsmith wrote:
>
> > We shouldn't enable the warning under -Wextra in language modes where there's no standard way to suppress it.
>
>
> That may be true, but that is not what the bugreport is about, it explicitly mentions flex. There are codebases that explicitly use -Wimplicit-fallthrough, and flex generates the same code even for C++. So either Clang needs to handle it, or flex needs to change (which may be non-trivial if https://bugs.llvm.org/show_bug.cgi?id=43465#c24 is right), or codebases using flex will need to either special-case Clang or live with the warning.
... or turn off the warning for generated code. As noted on that bug, `-Wimplicit-fallthrough` enforces a particular coding style, so users should expect to need to not enable it in generated code that doesn't follow that style. You might need to turn off (eg) `-Windent` or `-Wparentheses` in flex-generated code too.
In any case, none of this has any bearing on whether this patch has had sufficient review. It hasn't, so it needs to be reverted for now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73852/new/
https://reviews.llvm.org/D73852
More information about the cfe-commits
mailing list