forked from OSchip/llvm-project
[clang-tidy] Fix typo in bugprone-string-constructor.
s/bigger then/bigger than/ llvm-svn: 363053
This commit is contained in:
parent
1f6c602704
commit
f63feaf3c2
|
@ -134,7 +134,7 @@ void StringConstructorCheck::check(const MatchFinder::MatchResult &Result) {
|
|||
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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue