Skip to content

Commit b57f5b1

Browse files
committed
[clang] Fix LogDiagnosticPrinter.h and ClangTidyPlugin.cpp after 9e306ad
1 parent 73fda83 commit b57f5b1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ class ClangTidyPluginAction : public PluginASTAction {
4040
// Create and set diagnostics engine
4141
auto *DiagConsumer =
4242
new ClangTidyDiagnosticConsumer(*Context, &Compiler.getDiagnostics());
43+
auto DiagOpts = std::make_unique<DiagnosticOptions>();
4344
auto DiagEngine = std::make_unique<DiagnosticsEngine>(
44-
new DiagnosticIDs, new DiagnosticOptions, DiagConsumer);
45-
Context->setDiagnosticsEngine(DiagEngine.get());
45+
new DiagnosticIDs, *DiagOpts, DiagConsumer);
46+
Context->setDiagnosticsEngine(std::move(DiagOpts), DiagEngine.get());
4647

4748
// Create the AST consumer.
4849
ClangTidyASTConsumerFactory Factory(*Context);

clang/include/clang/Frontend/LogDiagnosticPrinter.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class LogDiagnosticPrinter : public DiagnosticConsumer {
5151
raw_ostream &OS;
5252
std::unique_ptr<raw_ostream> StreamOwner;
5353
const LangOptions *LangOpts;
54-
DiagnosticOptions &DiagOpts;
5554

5655
SourceLocation LastWarningLoc;
5756
FullSourceLoc LastLoc;

0 commit comments

Comments
 (0)