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(
129
129
<< HintFriend;
130
130
}
131
131
132
- auto WithFriendHintIfNeeded =
133
- [&](const DiagnosticBuilder &Diag,
134
- bool NeedsFriend) -> const DiagnosticBuilder & {
132
+ auto WithFriendHintIfNeeded = [&](const DiagnosticBuilder &Diag,
133
+ bool NeedsFriend) {
135
134
if (NeedsFriend)
136
135
Diag << HintFriend;
137
-
138
- return Diag;
139
136
};
140
137
141
138
if (!CRTPDeclaration->hasUserDeclaredConstructor ()) {
Original file line number Diff line number Diff line change @@ -370,16 +370,16 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) {
370
370
<< E->getSourceRange ();
371
371
} else if (Result.Nodes .getNodeAs <Stmt>(" loop-expr" )) {
372
372
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 ();
375
375
376
376
const auto *SzOfExpr = Result.Nodes .getNodeAs <Expr>(" sizeof-expr" );
377
377
378
- if (const auto type = dyn_cast<ArrayType>(SizeofArgTy)) {
378
+ if (const auto *Type = dyn_cast<ArrayType>(SizeofArgTy)) {
379
379
// check if the array element size is larger than one. If true,
380
380
// 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 ()) {
383
383
diag (SzOfExpr->getBeginLoc (),
384
384
" suspicious usage of 'sizeof' in the loop" )
385
385
<< SzOfExpr->getSourceRange ();
You can’t perform that action at this time.
0 commit comments