[PATCH] D50389: [clang-tidy] new check for Abseil

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 10 02:21:18 PDT 2018


JonasToth added inline comments.


================
Comment at: clang-tidy/abseil/DurationDivisionCheck.cpp:32
+          hasImplicitDestinationType(qualType(unless(isInteger()))),
+          unless(hasParent(cxxStaticCastExpr()))),
+      this);
----------------
deannagarcia wrote:
> JonasToth wrote:
> > What about different kinds of casts, like C-Style casts?
> > Doesn't the `hasImplicitDestinationType` already remove the possibility for an cast as destination?
> I know the test fails without this line and flags the casts, so I'm pretty sure it's necessary but I'm not exactly sure why hasImplicitDestinationType doesn't catch it.
Ok. I can not help there. Just leave as is :)


================
Comment at: docs/clang-tidy/checks/abseil-duration-division.rst:8
+division of two `absl::Duration` objects returns an `int64` with any fractional
+component truncated toward 0.
+
----------------
deannagarcia wrote:
> JonasToth wrote:
> > Please add one more sentence, why this is something you don't want, so it gets clear that floating point contextes are the interesting here.
> Does this link work or do you still want more?
Link is enough!


https://reviews.llvm.org/D50389





More information about the cfe-commits mailing list