File tree Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 1+ InheritParentConfig : true
2+ Checks : [
3+ bugprone-*,
4+ -bugprone-assignment-in-if-condition,
5+ -bugprone-branch-clone,
6+ -bugprone-easily-swappable-parameters,
7+ -bugprone-narrowing-conversions,
8+ -bugprone-suspicious-stringview-data-usage,
9+ -bugprone-unchecked-optional-access,
10+ -bugprone-unused-return-value
11+ ]
Original file line number Diff line number Diff line change @@ -129,13 +129,10 @@ void CrtpConstructorAccessibilityCheck::check(
129129 << HintFriend;
130130 }
131131
132- auto WithFriendHintIfNeeded =
133- [&](const DiagnosticBuilder &Diag,
134- bool NeedsFriend) -> const DiagnosticBuilder & {
132+ auto WithFriendHintIfNeeded = [&](const DiagnosticBuilder &Diag,
133+ bool NeedsFriend) {
135134 if (NeedsFriend)
136135 Diag << HintFriend;
137-
138- return Diag;
139136 };
140137
141138 if (!CRTPDeclaration->hasUserDeclaredConstructor ()) {
Original file line number Diff line number Diff line change @@ -370,16 +370,16 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) {
370370 << E->getSourceRange ();
371371 } else if (Result.Nodes .getNodeAs <Stmt>(" loop-expr" )) {
372372 auto *SizeofArgTy = Result.Nodes .getNodeAs <Type>(" sizeof-arg-type" );
373- if (const auto member = dyn_cast<MemberPointerType>(SizeofArgTy))
374- SizeofArgTy = member ->getPointeeType ().getTypePtr ();
373+ if (const auto *Member = dyn_cast<MemberPointerType>(SizeofArgTy))
374+ SizeofArgTy = Member ->getPointeeType ().getTypePtr ();
375375
376376 const auto *SzOfExpr = Result.Nodes .getNodeAs <Expr>(" sizeof-expr" );
377377
378- if (const auto type = dyn_cast<ArrayType>(SizeofArgTy)) {
378+ if (const auto *Type = dyn_cast<ArrayType>(SizeofArgTy)) {
379379 // check if the array element size is larger than one. If true,
380380 // the size of the array is higher than the number of elements
381- CharUnits sSize = Ctx.getTypeSizeInChars (type ->getElementType ());
382- if (!sSize .isOne ()) {
381+ CharUnits SSize = Ctx.getTypeSizeInChars (Type ->getElementType ());
382+ if (!SSize .isOne ()) {
383383 diag (SzOfExpr->getBeginLoc (),
384384 " suspicious usage of 'sizeof' in the loop" )
385385 << SzOfExpr->getSourceRange ();
You can’t perform that action at this time.
0 commit comments