[PATCH] D71607: [clang-tidy] Add unsigned subtraction warning, with suggestion to convert to unsigned literals.

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 17 09:55:32 PST 2019


lebedev.ri added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/UnsignedSubtractionCheck.cpp:21
+
+void UnsignedSubtractionCheck::registerMatchers(MatchFinder *Finder) {
+  const auto UnsignedIntType = hasType(isUnsignedInteger());
----------------
The check's name is more generic than what it does - it only looks at mixed subtractions in comparisons.
The name implies it looks at all mixed subtractions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71607





More information about the cfe-commits mailing list