This revision was automatically updated to reflect the committed changes.
Closed by commit rGde401ac2a4ab: [clang][Sema] Avoid duplicate diagnostics for
unreachable fallthrough attribute (authored by hazohelet, committed by
aaron.ballman).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145842/new/
https://reviews.llvm.org/D145842
___
cfe-commits mailing
hazohelet updated this revision to Diff 504933.
hazohelet added a comment.
Address comments from @aaron.ballman
- NFC stylistic changes
Thanks for the review! Since I don't have commit access, would you please land
this patch for me?
Please use "Takuya Shimizu " for the patch attribution.
aaron.ballman added a comment.
Thank you, I think this is heading in the right direction! Can you also add a
release note to `clang/docs/ReleaseNotes.rst` about the fix?
Comment at: clang/lib/Analysis/ReachableCode.cpp:633-635
+ const AttributedStmt *AS = dyn_cast(S);
+
hazohelet updated this revision to Diff 504697.
hazohelet added a comment.
Address comments from @aaron.ballman
- Dropped `const` qualifier from value objects for style consistency
- Passed boolean `HasFallThroughAttr` to callback and handled warning
suppression in `HandleUnreachable` in order
aaron.ballman added inline comments.
Comment at: clang/include/clang/Analysis/Analyses/ReachableCode.h:65
+ Callback ,
+ const bool UnreachableFallThroughDiagIsEnabled);
}} // end namespace clang::reachable_code
hazohelet updated this revision to Diff 504501.
hazohelet added a comment.
Address comments from @shafik
- Pass bool flag `UnreachableFallThroughDiagIsEnabled` instead of
`DiagnosticsEngine`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145842/new/
https://reviews.llvm.org/D145842
shafik added inline comments.
Comment at: clang/lib/Analysis/ReachableCode.cpp:674
+ if (AS && hasSpecificAttr(AS->getAttrs()) &&
+ !Diag.isIgnored(diag::warn_unreachable_fallthrough_attr,
+ SourceLocation())) {
Your passing through
hazohelet created this revision.
hazohelet added reviewers: tbaeder, aaron.ballman, cjdb.
Herald added a reviewer: NoQ.
Herald added a project: All.
hazohelet requested review of this revision.
Herald added a project: clang.
This patch checks whether `-Wunreachable-code-fallthrough` is enabled