Try out clang-tidy, starting with bugprone-use-after-move
- add drop-in clang-tidy cxx wrapper
- get build clean for bugprone-use-after-move
The wrapper can be used by setting
cxx = "/path/to/skia/tools/clang-tidy.sh"
in GN.
Change-Id: Idbba911e23bd6ef7530b08fd31906b92c1c1b28c
Reviewed-on: https://skia-review.googlesource.com/c/176523
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/tests/LListTest.cpp b/tests/LListTest.cpp
index e28cad9..f11e325 100644
--- a/tests/LListTest.cpp
+++ b/tests/LListTest.cpp
@@ -120,26 +120,31 @@
SkTInternalLList<ListElement> listA, listB;
listA.concat(std::move(listB));
check_list(listA, reporter, true, 0, false, false, false, false, elements);
+ // NOLINTNEXTLINE(bugprone-use-after-move)
check_list(listB, reporter, true, 0, false, false, false, false, elements);
listB.addToTail(&elements[0]);
listA.concat(std::move(listB));
check_list(listA, reporter, false, 1, true, false, false, false, elements);
+ // NOLINTNEXTLINE(bugprone-use-after-move)
check_list(listB, reporter, true, 0, false, false, false, false, elements);
listB.addToTail(&elements[1]);
listA.concat(std::move(listB));
check_list(listA, reporter, false, 2, true, true, false, false, elements);
+ // NOLINTNEXTLINE(bugprone-use-after-move)
check_list(listB, reporter, true, 0, false, false, false, false, elements);
listA.concat(std::move(listB));
check_list(listA, reporter, false, 2, true, true, false, false, elements);
+ // NOLINTNEXTLINE(bugprone-use-after-move)
check_list(listB, reporter, true, 0, false, false, false, false, elements);
listB.addToTail(&elements[2]);
listB.addToTail(&elements[3]);
listA.concat(std::move(listB));
check_list(listA, reporter, false, 4, true, true, true, true, elements);
+ // NOLINTNEXTLINE(bugprone-use-after-move)
check_list(listB, reporter, true, 0, false, false, false, false, elements);
cur = iter.init(listA, Iter::kHead_IterStart);