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

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 23 09:30:40 PDT 2018


JonasToth accepted this revision.
JonasToth added a comment.
This revision is now accepted and ready to land.

@alexfh you did comment before, do you want to add more? I have no issues left.

Please give alex the opportunity to react, but if he doesn't (he has a lot to do) you can commit in 3 days or so. Do you have commit access?



================
Comment at: clang-tidy/abseil/DurationFactoryFloatCheck.cpp:51
+          hasArgument(0,
+                      anyOf(cxxStaticCastExpr(
+                                hasDestinationType(realFloatingPointType()),
----------------
Nit: the duplication in the cast matcher can be removed with a variable `auto CastToFloat = hasDestinationType(realFloatingPointType()), hasSourceExpression(expr().bind("cast_arg"));` and then used in the matcher.


================
Comment at: clang-tidy/abseil/DurationFactoryFloatCheck.cpp:99
+    }
+  }
+}
----------------
is it logically valid to fall reach the end of the method?
If not please add an `llvm_unreachable()`


https://reviews.llvm.org/D53339





More information about the cfe-commits mailing list