[PATCH] D58977: [clang-tidy] Add the abseil-time-comparison check

Hyrum Wright via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 8 08:15:30 PST 2019


hwright added inline comments.


================
Comment at: clang-tidy/abseil/TimeComparisonCheck.cpp:23
+  auto Matcher =
+      binaryOperator(anyOf(hasOperatorName(">"), hasOperatorName(">="),
+                           hasOperatorName("=="), hasOperatorName("<="),
----------------
ioeric wrote:
> `DurationComparisonCheck.cpp` has a very similar matcher pattern.
> 
> Maybe pull out a common matcher for this? E.g. `comparisonOperatorWithCallee(...)`?
> 
My one concern about doing so is that it would move the name bindings into a separate location away from the callback consuming those bindings.

Since this is only the second instance of this pattern, would it be reasonable to wait until there's a third to combine them?


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

https://reviews.llvm.org/D58977





More information about the cfe-commits mailing list