@@ -1001,11 +1001,11 @@ std::unique_ptr<clang::CompilerInvocation> ClangImporter::createClangInvocation(
1001
1001
// the diagnostic options here explicitly.
1002
1002
std::unique_ptr<clang::DiagnosticOptions> clangDiagOpts =
1003
1003
clang::CreateAndPopulateDiagOpts (invocationArgs);
1004
- ClangDiagnosticConsumer diagClient{importer-> Impl , *clangDiagOpts,
1005
- importerOpts.DumpClangDiagnostics } ;
1004
+ auto * diagClient = new ClangDiagnosticConsumer (
1005
+ importer-> Impl , *clangDiagOpts, importerOpts.DumpClangDiagnostics ) ;
1006
1006
clangDiags = clang::CompilerInstance::createDiagnostics (
1007
- clangDiagOpts.release (), & diagClient,
1008
- /* owned*/ false );
1007
+ clangDiagOpts.release (), diagClient,
1008
+ /* owned*/ true );
1009
1009
1010
1010
// Finally, use the CC1 command-line and the diagnostic engine
1011
1011
// to instantiate our Invocation.
@@ -1025,11 +1025,11 @@ std::unique_ptr<clang::CompilerInvocation> ClangImporter::createClangInvocation(
1025
1025
llvm::IntrusiveRefCntPtr<clang::DiagnosticOptions> tempDiagOpts{
1026
1026
new clang::DiagnosticOptions};
1027
1027
1028
- ClangDiagnosticConsumer tempDiagClient{importer-> Impl , *tempDiagOpts,
1029
- importerOpts.DumpClangDiagnostics } ;
1028
+ auto * tempDiagClient = new ClangDiagnosticConsumer (
1029
+ importer-> Impl , *tempDiagOpts, importerOpts.DumpClangDiagnostics ) ;
1030
1030
clangDiags = clang::CompilerInstance::createDiagnostics (tempDiagOpts.get (),
1031
- & tempDiagClient,
1032
- /* owned*/ false );
1031
+ tempDiagClient,
1032
+ /* owned*/ true );
1033
1033
CI = clang::createInvocationFromCommandLine (invocationArgs, clangDiags, VFS,
1034
1034
false , CC1Args);
1035
1035
}
0 commit comments