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

Hyrum Wright via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 16 13:52:34 PDT 2018


hwright created this revision.
hwright added reviewers: alexfh, alexfh_.
Herald added a subscriber: mgorny.

This check finds cases where calls to an absl::Duration factory could use the more efficient integer overload.

For example:
// Original - Providing a floating-point literal.
absl::Duration d = absl::Seconds(10.0);

// Suggested - Use an integer instead.
absl::Duration d = absl::Seconds(10);


https://reviews.llvm.org/D53339

Files:
  clang-tidy/abseil/AbseilTidyModule.cpp
  clang-tidy/abseil/CMakeLists.txt
  clang-tidy/abseil/DurationFactoryFloatCheck.cpp
  clang-tidy/abseil/DurationFactoryFloatCheck.h
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/abseil-duration-factory-float.rst
  docs/clang-tidy/checks/list.rst
  test/clang-tidy/abseil-duration-factory-float.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53339.169887.patch
Type: text/x-patch
Size: 12598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181016/687c6720/attachment.bin>


More information about the cfe-commits mailing list