Skip to content

Commit ab21a77

Browse files
committed
Fix nits from @vbvictor
1 parent 7fd0a21 commit ab21a77

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
namespace clang::tidy::readability {
1616

17-
/// Replaces certain integer literals with equivalent calls to
18-
/// ``std::numeric_limits``.
17+
/// Finds certain integer literals and suggests replacing them with equivalent
18+
/// ``std::numeric_limits`` calls.
1919
/// For the user-facing documentation see:
2020
/// http://clang.llvm.org/extra/clang-tidy/checks/readability/use-numeric-limits.html
2121
class UseNumericLimitsCheck : public ClangTidyCheck {

clang-tools-extra/docs/clang-tidy/checks/readability/use-numeric-limits.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
readability-use-numeric-limits
44
==============================
55

6-
Replaces certain integer literals with equivalent calls to
7-
``std::numeric_limits<T>::min()`` or ``std::numeric_limits<T>::max()``.
6+
Finds certain integer literals and suggests replacing them with equivalent
7+
``std::numeric_limits`` calls.
88

99
Before:
1010

clang-tools-extra/test/clang-tidy/checkers/readability/use-numeric-limits.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
// RUN: %check_clang_tidy %s readability-use-numeric-limits %t
2-
#include <stdint.h>
2+
// CHECK-FIXES: #include <limits>
3+
4+
using int8_t = signed char;
5+
using int16_t = short;
6+
using int32_t = int;
7+
using int64_t = long long;
8+
using uint8_t = unsigned char;
9+
using uint16_t = unsigned short;
10+
using uint32_t = unsigned int;
11+
using uint64_t = unsigned long long;
12+
313

414
void Invalid() {
515
// CHECK-MESSAGES: :[[@LINE+2]]:14: warning: the constant '-128' is being utilized; consider using 'std::numeric_limits<int8_t>::min()' instead [readability-use-numeric-limits]

0 commit comments

Comments
 (0)