[PATCH] D53339: [clang-tidy] Add the abseil-duration-factory-float check

Hyrum Wright via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 23 18:46:59 PDT 2018


hwright marked 4 inline comments as done.
hwright added inline comments.


================
Comment at: clang-tidy/abseil/DurationFactoryFloatCheck.cpp:36
+
+static bool InsideMacroDefinition(const MatchFinder::MatchResult &Result,
+                                  SourceRange Range) {
----------------
aaron.ballman wrote:
> This function name doesn't seem to relate to the behavior of the function? Rather than try to pin it down like that, perhaps rename to "CanRangeBeSafelyReplaced()` and add a comment as to why this is the correct approach for answering the question.
I've added a comment describing what the function does, but leaving the name the same.

Since this isn't the only reason why we reject a given range, and I think keeping those decisions co-located is probably best, I'd like to leave that logic in the `check` method below, rather than moving part of it up here.


https://reviews.llvm.org/D53339





More information about the cfe-commits mailing list