@@ -1048,11 +1048,11 @@ std::unique_ptr<clang::CompilerInvocation> ClangImporter::createClangInvocation(
1048
1048
// the diagnostic options here explicitly.
1049
1049
std::unique_ptr<clang::DiagnosticOptions> clangDiagOpts =
1050
1050
clang::CreateAndPopulateDiagOpts (invocationArgs);
1051
- ClangDiagnosticConsumer diagClient{importer-> Impl , *clangDiagOpts,
1052
- importerOpts.DumpClangDiagnostics } ;
1051
+ auto * diagClient = new ClangDiagnosticConsumer (
1052
+ importer-> Impl , *clangDiagOpts, importerOpts.DumpClangDiagnostics ) ;
1053
1053
clangDiags = clang::CompilerInstance::createDiagnostics (
1054
- clangDiagOpts.release (), & diagClient,
1055
- /* owned*/ false );
1054
+ clangDiagOpts.release (), diagClient,
1055
+ /* owned*/ true );
1056
1056
1057
1057
// Finally, use the CC1 command-line and the diagnostic engine
1058
1058
// to instantiate our Invocation.
@@ -1072,11 +1072,11 @@ std::unique_ptr<clang::CompilerInvocation> ClangImporter::createClangInvocation(
1072
1072
llvm::IntrusiveRefCntPtr<clang::DiagnosticOptions> tempDiagOpts{
1073
1073
new clang::DiagnosticOptions};
1074
1074
1075
- ClangDiagnosticConsumer tempDiagClient{importer-> Impl , *tempDiagOpts,
1076
- importerOpts.DumpClangDiagnostics } ;
1075
+ auto * tempDiagClient = new ClangDiagnosticConsumer (
1076
+ importer-> Impl , *tempDiagOpts, importerOpts.DumpClangDiagnostics ) ;
1077
1077
clangDiags = clang::CompilerInstance::createDiagnostics (tempDiagOpts.get (),
1078
- & tempDiagClient,
1079
- /* owned*/ false );
1078
+ tempDiagClient,
1079
+ /* owned*/ true );
1080
1080
CI = clang::createInvocationFromCommandLine (invocationArgs, clangDiags, VFS,
1081
1081
false , CC1Args);
1082
1082
}
0 commit comments