Index: clang-tools-extra/clang-tidy/readability/UppercaseLiteralSuffixCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/readability/UppercaseLiteralSuffixCheck.cpp +++ clang-tools-extra/clang-tidy/readability/UppercaseLiteralSuffixCheck.cpp @@ -134,6 +134,11 @@ CharSourceRange::getTokenRange(*Range), SM, LO, &Invalid); assert(!Invalid && "Failed to retrieve the source text."); + // Make sure the first character is actually a digit + // https://bugs.llvm.org/show_bug.cgi?id=51790 + if (!std::isdigit(static_cast(LiteralSourceText.front()))) + return llvm::None; + size_t Skip = 0; // Do we need to ignore something before actually looking for the suffix? Index: clang-tools-extra/test/clang-tidy/checkers/readability-uppercase-literal-suffix-integer.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability-uppercase-literal-suffix-integer.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability-uppercase-literal-suffix-integer.cpp @@ -270,3 +270,17 @@ void d(); void d() { c(); } } // namespace + +// Check that non-type template parameters do not cause any diags. +// https://bugs.llvm.org/show_bug.cgi?id=51790 +template +struct Vector { + static constexpr int kCapacity = capacity; +}; + +template +constexpr int Vector::kCapacity; + +void test_vector() { + int x = Vector<10>::kCapacity; +}