[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-17 Thread Benjamin Bannier via Phabricator via cfe-commits
bbannier added a comment. Thanks for reviews and @xgupta for pushing this over the finish line. This had been lingering a long time. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784 __

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-16 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta added a comment. In D4784#4504690 , @PiotrZSL wrote: > Just few nits (column numbers in test, missing doxygen comment, ...). > Please fix those before committing. > > Except that, looking good to me. Thanks for this nice code review. Repository:

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-16 Thread Shivam Gupta via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG42179bbf6bcc: [clang-tidy] Add check for possibly incomplete switch statements (authored by shivam-amd). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-16 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 540857. xgupta marked 6 inline comments as done. xgupta added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784 Files: clang-tools-extra/clang-

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-16 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL accepted this revision. PiotrZSL added a comment. This revision is now accepted and ready to land. Just few nits (column numbers in test, missing doxygen comment, ...). Please fix those before committing. Except that, looking good to me. Comment at: clang-tools-extra

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-16 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 540845. xgupta marked an inline comment as done. xgupta added a comment. Updated testcase [WIP] Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784 Files: clang-tools-extra/

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-16 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Tests need to be reverted, and template handling corrected (check comments). After that it looks good to me. Comment at: clang-tools-extra/clang-tidy/bugprone/SwitchMissingDefaultCaseCheck.cpp:29 + Finder->addMatcher( + switchStmt(hasCondition(e

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-16 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/SwitchMissingDefaultCaseCheck.cpp:19 + Finder->addMatcher( + switchStmt(has(implicitCastExpr().bind("cast")), + unless(hasAncestor(switchStmt(has(defaultStmt())

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-16 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 540818. xgupta marked 5 inline comments as done. xgupta added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784 Files: clang-tools-extra/clang-

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-16 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/SwitchMissingDefaultCaseCheck.cpp:19 + Finder->addMatcher( + switchStmt(has(implicitCastExpr().bind("cast")), + unless(hasAncestor(switchStmt(has(defaultStmt()) --

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-16 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/SwitchMissingDefaultCaseCheck.cpp:16-29 +void SwitchMissingDefaultCaseCheck::registerMatchers( +ast_matchers::MatchFinder *Finder) { + Finder->addMatcher( + switchStmt(has(implicitCastExp

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-16 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta marked 3 inline comments as done. xgupta added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/SwitchMissingDefaultCaseCheck.cpp:16-29 +void SwitchMissingDefaultCaseCheck::registerMatchers( +ast_matchers::MatchFinder *Finder) { + Finder->addMatcher

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-16 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 540798. xgupta marked an inline comment as done. xgupta added a comment. Address comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784 Files: clang-tools-extra/clang-t

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-13 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta marked an inline comment as done. xgupta added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone/switch-missing-default-case.rst:52 +.. note:: + Enum types are already covered by compiler warnings when a switch statement + does not handle

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-13 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 540119. xgupta marked an inline comment as done. xgupta added a comment. Address latest two comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784 Files: clang-tools-e

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-13 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 540102. xgupta added a comment. Updated SwitchMissingDefaultCaseCheck.cpp but still WIP Will look again on saturday/sunday Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-13 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone/switch-missing-default-case.rst:52 +.. note:: + Enum types are already covered by compiler warnings when a switch statement + does not handle all enum values. This check focuses on

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-12 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:225 + + Ensures that incomplete switch statements without default cases are + flagged, covering cases beyond enums where the compiler may not issue warnings. PiotrZSL wrote: > ac

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-12 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 539857. xgupta marked 12 inline comments as done. xgupta added a comment. Address all comments excpet in SwitchMissingDefaultCaseCheck.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-12 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/switch-missing-default-case.cpp:27 + } +} Add also tests with int/enum behind typedef and no default case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-12 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/SwitchMissingDefaultCaseCheck.cpp:16-29 +void SwitchMissingDefaultCaseCheck::registerMatchers( +ast_matchers::MatchFinder *Finder) { + Finder->addMatcher( + switchStmt(has(implicitCastExp

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-12 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 539602. xgupta added a comment. Add documentation Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp c

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-12 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 539593. xgupta marked 3 inline comments as done. xgupta added a comment. Address more comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784 Files: clang-tools-extra/c

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-12 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 539558. xgupta edited the summary of this revision. xgupta added a comment. Address some comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784 Files: clang-tools-extr

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-12 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL requested changes to this revision. PiotrZSL added a comment. This revision now requires changes to proceed. Missing documentation for check. Once you ready with update, please switch review into ready for review. Comment at: clang-tools-extra/clang-tidy/misc/Incomplet

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-11 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 539390. xgupta added a comment. Update ReleaseNotes.rst CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt clang-tools-extra/clang-tidy/misc/IncompleteSw

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-11 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 539389. xgupta added a comment. Address bkramer's comments except one for "checking that you're casting from an enum". CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784 Files: clang-tools-extra/clang-tidy/misc

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-11 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 539383. xgupta added a comment. . CHANGES SINCE LAST ACTION https://reviews.llvm.org/D4784/new/ https://reviews.llvm.org/D4784 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt clang-tools-extra/clang-tidy/misc/IncompleteSwitchCheck.cpp clang-

[PATCH] D4784: [clang-tidy] Add check for possibly incomplete switch statements

2023-07-11 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 539378. xgupta retitled this revision from "[clang-tidy] Add check for possibly incomplete switch statements " to "[clang-tidy] Add check for possibly incomplete switch statements". xgupta added a reviewer: PiotrZSL. xgupta added a comment. Herald added a revie