Previously, we'd only match on literal floating or integral zeroes, but I've now also learned that some users spell that value as int{0} or float{0}, which also need to be matched.
Details
Diff Detail
Event Timeline
| test/clang-tidy/abseil-duration-factory-scale.cpp | ||
|---|---|---|
| 3 | cstdint, please. | |
| clang-tidy/abseil/DurationRewriter.cpp | ||
|---|---|---|
| 110 | Spurious parens can be removed. | |
| test/clang-tidy/abseil-duration-factory-scale.cpp | ||
| 3 | Rather than write this as an include, I'd rather just do: namespace std { typedef long long int64_t; } using int64_t = std::int64_t; Then there's no question about whether this is using the host stdint.h or the current-clang-stdint.h. | |
| 34 | Do you also have users doing something like: absl::Seconds(int{});? | |
One random late comment.
| clang-tools-extra/trunk/test/clang-tidy/abseil-duration-factory-scale.cpp | ||
|---|---|---|
| 38 ↗ | (On Diff #179341) | I'd add more context to the CHECK-FIXES patterns, otherwise they are not very reliable. There's no implicit connection to the line numbers, so any long enough subsequence of lines containing 'absl::ZeroDuration()' would satisfy the test. One way to do that is to declare variables with unique names. Another is to add unique comments. |
Spurious parens can be removed.