Skip to content

Commit 6683cde

Browse files
committed
Addressed review comments.
1 parent 27925c3 commit 6683cde

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AST_MATCHER(StringLiteral, isOrdinary) { return Node.isOrdinary(); }
2323
} // namespace
2424

2525
UseStdPrintCheck::UseStdPrintCheck(StringRef Name, ClangTidyContext *Context)
26-
: ClangTidyCheck(Name, Context), PP(PP),
26+
: ClangTidyCheck(Name, Context), PP(nullptr),
2727
StrictMode(Options.getLocalOrGlobal("StrictMode", false)),
2828
PrintfLikeFunctions(utils::options::parseStringList(
2929
Options.get("PrintfLikeFunctions", ""))),
@@ -131,6 +131,7 @@ void UseStdPrintCheck::check(const MatchFinder::MatchResult &Result) {
131131
utils::FormatStringConverter::Configuration ConverterConfig;
132132
ConverterConfig.StrictMode = StrictMode;
133133
ConverterConfig.AllowTrailingNewlineRemoval = true;
134+
assert(PP && "Preprocessor should be set by registerPPCallbacks");
134135
utils::FormatStringConverter Converter(
135136
Result.Context, Printf, FormatArgOffset, ConverterConfig, getLangOpts(),
136137
*Result.SourceManager, *PP);

0 commit comments

Comments
 (0)