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())))))
----------------
xgupta wrote:
> PiotrZSL wrote:
> > this should be something like:
> > ```hasCondition(expr(hasType(qualType(hasCanonicalType(unless(hasDeclaration(enumDecl()))))))```
> > Or you can verify just if type is integral type.
> > Note that with modern C++ you may have init statements in enums.
> > 
> For some reason, the check is giving warning for enum cases and I couldn't 
> understand why, can you please help?
Add getCheckTraversalKind and check again....


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D4784

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to