[PATCH] D52892: [Clang-tidy] readability check to convert numerical constants to std::numeric_limits

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 8 08:55:28 PDT 2018


lebedev.ri added inline comments.


================
Comment at: clang-tidy/readability/NumericalCostantsToMaxIntCheck.h:25
+///
+class NumericalCostantsToMaxIntCheck : public ClangTidyCheck {
+public:
----------------
I feel like the name is overly vague.
This *only* handles the cases of `-1` and `~0`.
It does not handle cases like `255` -> `std::numeric_limits<uint_8>::max()`.
(It might be nice to do that, but it is more complex i suspect.)


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52892





More information about the cfe-commits mailing list