@@ -995,11 +995,11 @@ std::unique_ptr<clang::CompilerInvocation> ClangImporter::createClangInvocation(
995
995
// the diagnostic options here explicitly.
996
996
std::unique_ptr<clang::DiagnosticOptions> clangDiagOpts =
997
997
clang::CreateAndPopulateDiagOpts (invocationArgs);
998
- ClangDiagnosticConsumer diagClient{importer-> Impl , *clangDiagOpts,
999
- importerOpts.DumpClangDiagnostics } ;
998
+ auto * diagClient = new ClangDiagnosticConsumer (
999
+ importer-> Impl , *clangDiagOpts, importerOpts.DumpClangDiagnostics ) ;
1000
1000
clangDiags = clang::CompilerInstance::createDiagnostics (
1001
- clangDiagOpts.release (), & diagClient,
1002
- /* owned*/ false );
1001
+ clangDiagOpts.release (), diagClient,
1002
+ /* owned*/ true );
1003
1003
1004
1004
// Finally, use the CC1 command-line and the diagnostic engine
1005
1005
// to instantiate our Invocation.
@@ -1019,11 +1019,11 @@ std::unique_ptr<clang::CompilerInvocation> ClangImporter::createClangInvocation(
1019
1019
llvm::IntrusiveRefCntPtr<clang::DiagnosticOptions> tempDiagOpts{
1020
1020
new clang::DiagnosticOptions};
1021
1021
1022
- ClangDiagnosticConsumer tempDiagClient{importer-> Impl , *tempDiagOpts,
1023
- importerOpts.DumpClangDiagnostics } ;
1022
+ auto * tempDiagClient = new ClangDiagnosticConsumer (
1023
+ importer-> Impl , *tempDiagOpts, importerOpts.DumpClangDiagnostics ) ;
1024
1024
clangDiags = clang::CompilerInstance::createDiagnostics (tempDiagOpts.get (),
1025
- & tempDiagClient,
1026
- /* owned*/ false );
1025
+ tempDiagClient,
1026
+ /* owned*/ true );
1027
1027
CI = clang::createInvocationFromCommandLine (invocationArgs, clangDiags, VFS,
1028
1028
false , CC1Args);
1029
1029
}
0 commit comments