@@ -995,11 +995,11 @@ std::unique_ptr<clang::CompilerInvocation> ClangImporter::createClangInvocation(
995995 // the diagnostic options here explicitly.
996996 std::unique_ptr<clang::DiagnosticOptions> clangDiagOpts =
997997 clang::CreateAndPopulateDiagOpts (invocationArgs);
998- ClangDiagnosticConsumer diagClient{importer-> Impl , *clangDiagOpts,
999- importerOpts.DumpClangDiagnostics } ;
998+ auto * diagClient = new ClangDiagnosticConsumer (
999+ importer-> Impl , *clangDiagOpts, importerOpts.DumpClangDiagnostics ) ;
10001000 clangDiags = clang::CompilerInstance::createDiagnostics (
1001- clangDiagOpts.release (), & diagClient,
1002- /* owned*/ false );
1001+ clangDiagOpts.release (), diagClient,
1002+ /* owned*/ true );
10031003
10041004 // Finally, use the CC1 command-line and the diagnostic engine
10051005 // to instantiate our Invocation.
@@ -1019,11 +1019,11 @@ std::unique_ptr<clang::CompilerInvocation> ClangImporter::createClangInvocation(
10191019 llvm::IntrusiveRefCntPtr<clang::DiagnosticOptions> tempDiagOpts{
10201020 new clang::DiagnosticOptions};
10211021
1022- ClangDiagnosticConsumer tempDiagClient{importer-> Impl , *tempDiagOpts,
1023- importerOpts.DumpClangDiagnostics } ;
1022+ auto * tempDiagClient = new ClangDiagnosticConsumer (
1023+ importer-> Impl , *tempDiagOpts, importerOpts.DumpClangDiagnostics ) ;
10241024 clangDiags = clang::CompilerInstance::createDiagnostics (tempDiagOpts.get (),
1025- & tempDiagClient,
1026- /* owned*/ false );
1025+ tempDiagClient,
1026+ /* owned*/ true );
10271027 CI = clang::createInvocationFromCommandLine (invocationArgs, clangDiags, VFS,
10281028 false , CC1Args);
10291029 }
0 commit comments