[PATCH] D50389: [clang-tidy] Abseil: integral division of Duration check

Deanna Garcia via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 14 07:34:05 PDT 2018


deannagarcia added inline comments.


================
Comment at: test/clang-tidy/abseil-duration-division.cpp:58
+  // CHECK-MESSAGES: [[@LINE-4]]:45: warning: operator/ on absl::Duration objects
+  // CHECK-FIXES: double DoubleDivision(T t1, T t2) {return
+  // absl::FDivDuration(t1, t2);}
----------------
hokein wrote:
> deannagarcia wrote:
> > hokein wrote:
> > > I think we should ignore templates. The template function could be used by other types, fixing the template is not correct. 
> > I removed this template function, but left the template function TakesGeneric below to show that the automatic type does not require/give a warning. Is that alright?
> The check will still give warnings in the template instantiation,  I think we need `unless(isInTemplateInstantiation()` matcher to filter them out.
I added that and then put the test back to show that it now won't trigger a warning. Is that what you wanted?


https://reviews.llvm.org/D50389





More information about the cfe-commits mailing list