[PATCH] D37808: [clang-tidy] Add new hicpp-multiway-paths-covered check for missing branches

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 18 01:36:12 PDT 2017


JonasToth marked 4 inline comments as done.
JonasToth added inline comments.


================
Comment at: clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp:98
+  // hold.
+  const std::size_t BitCount = [&T, &Context]() {
+    if (T->isIntegralType(Context))
----------------
JDevlieghere wrote:
> Unless you expect a whole bunch of logic to be added here, I'd un-const and initialize BitCount to zero, then just have if-clause reassign it and get rid of the lambda. This will save you a few lines of code and complexity. 
I dont know if i missed some integral types, that need special care, so this one was defensive.

But with the refactoring i made, I should change this, agreed.


https://reviews.llvm.org/D37808





More information about the cfe-commits mailing list