[PATCH] D63192: [Diagnostics] Implement -Wswitch-default

2019-07-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D63192#1578867 , @xbolva00 wrote: > I see. I should really check clang-tidy codebase :) I have a hunch that this will be equally as trivially implementable in clang-tidy -- if you go that route, feel free to add me as a

[PATCH] D63192: [Diagnostics] Implement -Wswitch-default

2019-07-10 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 planned changes to this revision. xbolva00 added a comment. I see. I should really check clang-tidy codebase :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63192/new/ https://reviews.llvm.org/D63192 ___ cfe-commits mailing list c

[PATCH] D63192: [Diagnostics] Implement -Wswitch-default

2019-07-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I'm wary of adding this as an on-by-default warning, despite its presence in MSVC (and despite submitting a similar patch years ago to implement the same functionality). Machine-generated code runs into this one frequently (we've been bitten by it numerous times w

[PATCH] D63192: [Diagnostics] Implement -Wswitch-default

2019-07-10 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 updated this revision to Diff 208984. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63192/new/ https://reviews.llvm.org/D63192 Files: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaStmt.cpp test/Sema/switch-availability.c

[PATCH] D63192: [Diagnostics] Implement -Wswitch-default

2019-07-10 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. In D63192#1539605 , @xbolva00 wrote: > I will work on this after we land https://reviews.llvm.org/D63139. ^ not yet landed, but please @aaron.ballman take a look, this patch is ready for review. CHANGES SINCE LAST ACTION h

[PATCH] D63192: [Diagnostics] Implement -Wswitch-default

2019-07-10 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 updated this revision to Diff 208974. xbolva00 added a comment. Rebased, improved. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63192/new/ https://reviews.llvm.org/D63192 Files: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/

[PATCH] D63192: [Diagnostics] Implement -Wswitch-default

2019-06-12 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 marked an inline comment as done. xbolva00 added inline comments. Comment at: lib/Sema/SemaStmt.cpp:869 + SwitchCase *SC = SS->getSwitchCaseList(); + if (!SC) +Diag(SS->getBeginLoc(), diag::warn_empty_switch_body); TODO: if (!SC) -> switch has no

[PATCH] D63192: [Diagnostics] Implement -Wswitch-default

2019-06-12 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 planned changes to this revision. xbolva00 added a comment. I will work on this after we land https://reviews.llvm.org/D63139. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63192/new/ https://reviews.llvm.org/D63192 ___

[PATCH] D63192: [Diagnostics] Implement -Wswitch-default

2019-06-12 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 created this revision. xbolva00 added reviewers: hfinkel, lattner, rsmith. Herald added a project: clang. Herald added a subscriber: cfe-commits. For MSVC compatibility, based on request in https://bugs.llvm.org/show_bug.cgi?id=4546. Repository: rC Clang https://reviews.llvm.org/D63