Skip to content

Commit 73036cf

Browse files
authored
[clang-tidy][NFC] Fix miscellaneous clang-tidy warnings (#170424)
1 parent d05370e commit 73036cf

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ void ExceptionEscapeCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
7272

7373
void ExceptionEscapeCheck::registerMatchers(MatchFinder *Finder) {
7474
auto MatchIf = [](bool Enabled, const auto &Matcher) {
75-
ast_matchers::internal::Matcher<FunctionDecl> Nothing = unless(anything());
75+
const ast_matchers::internal::Matcher<FunctionDecl> Nothing =
76+
unless(anything());
7677
return Enabled ? Matcher : Nothing;
7778
};
7879
Finder->addMatcher(

clang-tools-extra/clang-tidy/modernize/UseStdPrintCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class UseStdPrintCheck : public ClangTidyCheck {
3636
}
3737

3838
private:
39-
Preprocessor *PP;
39+
Preprocessor *PP = nullptr;
4040
bool StrictMode;
4141
std::vector<StringRef> PrintfLikeFunctions;
4242
std::vector<StringRef> FprintfLikeFunctions;

clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ std::string IdentifierNamingCheck::HungarianNotation::getDeclTypeName(
318318
if (!EOL)
319319
EOL = Begin + strlen(Begin);
320320

321-
const char *PosList[] = {strchr(Begin, '='), strchr(Begin, ';'),
322-
strchr(Begin, ','), strchr(Begin, ')'), EOL};
321+
const char *const PosList[] = {strchr(Begin, '='), strchr(Begin, ';'),
322+
strchr(Begin, ','), strchr(Begin, ')'), EOL};
323323
for (const auto &Pos : PosList) {
324324
if (Pos > Begin)
325325
EOL = std::min(EOL, Pos);

0 commit comments

Comments
 (0)