hokein added a comment.

Could you also update the check documentation 
`clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst`?



================
Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:83
+  } else {
+    llvm_unreachable("Invalid state");
   }
----------------
We expect that there are only two possible cases here, how about rearrange the 
code like below, which I think it would simpler and improve code readability.

```
if (const auto *Op = Nodes.getNodeAs<BinaryOperator>("op")) {
  // handle case for "op".
  return;
}
const auto *Cast = Nodes.getNodeAs<ImplicitCastExpr>("cast");
assert(Cast && "must be cast cases");
// ...
```


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53488



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

Reply via email to