Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions clang-tools-extra/clang-tidy/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Checks: >
-bugprone-narrowing-conversions,
-bugprone-unchecked-optional-access,
-bugprone-unused-return-value,
cppcoreguidelines-init-variables,
cppcoreguidelines-missing-std-forward,
cppcoreguidelines-rvalue-reference-param-not-moved,
cppcoreguidelines-virtual-class-destructor,
misc-const-correctness,
modernize-*,
-modernize-avoid-c-arrays,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ void UnsafeFunctionsCheck::registerMatchers(MatchFinder *Finder) {
}

void UnsafeFunctionsCheck::check(const MatchFinder::MatchResult &Result) {
const Expr *SourceExpr;
const FunctionDecl *FuncDecl;
const Expr *SourceExpr = nullptr;
const FunctionDecl *FuncDecl = nullptr;

if (const auto *DeclRef = Result.Nodes.getNodeAs<DeclRefExpr>(DeclRefId)) {
SourceExpr = DeclRef;
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-tidy/utils/UseRangesCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void UseRangesCheck::check(const MatchFinder::MatchResult &Result) {
if (!NodeStr.consume_front(FuncDecl))
continue;
Function = Value.get<FunctionDecl>();
size_t Index;
size_t Index = 0;
if (NodeStr.getAsInteger(10, Index)) {
llvm_unreachable("Unable to extract replacer index");
}
Expand Down
Loading