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

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 12 04:05:33 PDT 2019


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 default and case labels (empty body is misleading.. switch(x) x = b)

switch (x) {
   // warn_empty_switch_body
}


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63192/new/

https://reviews.llvm.org/D63192





More information about the cfe-commits mailing list