[PATCH] D62412: [clang-tidy] Fix unused-variable warning after r361647.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 27 00:33:27 PDT 2019


ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp:21
     : ClangTidyCheck(Name, Context), Rule(std::move(R)) {
-  for (const auto &Case : Rule.Cases) {
-    assert(Case.Explanation != nullptr &&
-           "clang-tidy checks must have an explanation by default;"
-           " explicitly provide an empty explanation if none is desired");
-  }
+  assert(std::all_of(Rule.Cases.begin(), Rule.Cases.end(),
+                     [](const RewriteRule::Case &C) {
----------------
NIT: use `llvm::all_of` avoid typing the container name twice.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62412





More information about the cfe-commits mailing list