Skip to content

Commit

Permalink
[clang-tidy][NFC] Fix clang-analyzer-optin.cplusplus.UninitializedObj…
Browse files Browse the repository at this point in the history
…ect findings

Fix issues found by clang-tidy in clang-tidy source directory.
  • Loading branch information
PiotrZSL committed Aug 27, 2023
1 parent 01c8bf6 commit 857f532
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ static bool paramReferredExactlyOnce(const CXXConstructorDecl *Ctor,
/// the
/// given constructor.
bool hasExactlyOneUsageIn(const CXXConstructorDecl *Ctor) {
Count = 0;
Count = 0U;
TraverseDecl(const_cast<CXXConstructorDecl *>(Ctor));
return Count == 1;
return Count == 1U;
}

private:
Expand All @@ -88,7 +88,7 @@ static bool paramReferredExactlyOnce(const CXXConstructorDecl *Ctor,
if (const ParmVarDecl *To = dyn_cast<ParmVarDecl>(D->getDecl())) {
if (To == ParamDecl) {
++Count;
if (Count > 1) {
if (Count > 1U) {
// No need to look further, used more than once.
return false;
}
Expand All @@ -98,7 +98,7 @@ static bool paramReferredExactlyOnce(const CXXConstructorDecl *Ctor,
}

const ParmVarDecl *ParamDecl;
unsigned Count;
unsigned Count = 0U;
};

return ExactlyOneUsageVisitor(ParamDecl).hasExactlyOneUsageIn(Ctor);
Expand Down

0 comments on commit 857f532

Please sign in to comment.