mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-18 23:30:28 +00:00
In C++ interop, stop referring to the diagnostics consumer before deleting it (#5149)
Part of #4666
This commit is contained in:
1 parent
a62a8cfd84
commit
3a5e18b1a1
1 file changed
+3
@@ -70,6 +70,9 @@ static auto GenerateAst(Context& context, llvm::StringRef importing_file_path,
|
||||
"clang-tool", std::make_shared<clang::PCHContainerOperations>(),
|
||||
clang::tooling::getClangStripDependencyFileAdjuster(),
|
||||
clang::tooling::FileContentMappings(), &diagnostics_consumer, fs);
|
||||
// Remove link to the diagnostics consumer before its deletion.
|
||||
ast->getDiagnostics().setClient(nullptr);
|
||||
|
||||
// TODO: Implement and use a DynamicRecursiveASTVisitor to traverse the AST.
|
||||
int num_errors = diagnostics_consumer.getNumErrors();
|
||||
int num_warnings = diagnostics_consumer.getNumWarnings();
|
||||
|
||||
Reference in new issue
Block a user