[clang-tools-extra] r363053 - [clang-tidy] Fix typo in bugprone-string-constructor.
Clement Courbet via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 11 05:12:06 PDT 2019
Author: courbet
Date: Tue Jun 11 05:12:06 2019
New Revision: 363053
URL: http://llvm.org/viewvc/llvm-project?rev=363053&view=rev
Log:
[clang-tidy] Fix typo in bugprone-string-constructor.
s/bigger then/bigger than/
Modified:
clang-tools-extra/trunk/clang-tidy/bugprone/StringConstructorCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/bugprone-string-constructor.cpp
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/StringConstructorCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/StringConstructorCheck.cpp?rev=363053&r1=363052&r2=363053&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/StringConstructorCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/StringConstructorCheck.cpp Tue Jun 11 05:12:06 2019
@@ -134,7 +134,7 @@ void StringConstructorCheck::check(const
const auto *Str = Result.Nodes.getNodeAs<StringLiteral>("str");
const auto *Lit = Result.Nodes.getNodeAs<IntegerLiteral>("int");
if (Lit->getValue().ugt(Str->getLength())) {
- diag(Loc, "length is bigger then string literal size");
+ diag(Loc, "length is bigger than string literal size");
}
} else if (const auto *Ptr = Result.Nodes.getNodeAs<Expr>("from-ptr")) {
Expr::EvalResult ConstPtr;
Modified: clang-tools-extra/trunk/test/clang-tidy/bugprone-string-constructor.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-string-constructor.cpp?rev=363053&r1=363052&r2=363053&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-string-constructor.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-string-constructor.cpp Tue Jun 11 05:12:06 2019
@@ -39,11 +39,11 @@ void Test() {
std::string q1(kText, -4);
// CHECK-MESSAGES: [[@LINE-1]]:15: warning: negative value used as length parameter
std::string q2("test", 200);
- // CHECK-MESSAGES: [[@LINE-1]]:15: warning: length is bigger then string literal size
+ // CHECK-MESSAGES: [[@LINE-1]]:15: warning: length is bigger than string literal size
std::string q3(kText, 200);
- // CHECK-MESSAGES: [[@LINE-1]]:15: warning: length is bigger then string literal size
+ // CHECK-MESSAGES: [[@LINE-1]]:15: warning: length is bigger than string literal size
std::string q4(kText2, 200);
- // CHECK-MESSAGES: [[@LINE-1]]:15: warning: length is bigger then string literal size
+ // CHECK-MESSAGES: [[@LINE-1]]:15: warning: length is bigger than string literal size
std::string q5(kText3, 0x1000000);
// CHECK-MESSAGES: [[@LINE-1]]:15: warning: suspicious large length parameter
std::string q6(nullptr);
More information about the cfe-commits
mailing list