diff --git a/src/tools/clangpchmanagerbackend/source/generatepchactionfactory.h b/src/tools/clangpchmanagerbackend/source/generatepchactionfactory.h index 50061a9e6cb..2b1f4d036da 100644 --- a/src/tools/clangpchmanagerbackend/source/generatepchactionfactory.h +++ b/src/tools/clangpchmanagerbackend/source/generatepchactionfactory.h @@ -27,6 +27,7 @@ #include +#include #include #include #include @@ -44,6 +45,9 @@ public: bool BeginInvocation(clang::CompilerInstance &compilerInstance) override { compilerInstance.getPreprocessorOpts().DisablePCHValidation = true; + compilerInstance.getPreprocessorOpts().AllowPCHWithCompilerErrors = true; + compilerInstance.getLangOpts().DelayedTemplateParsing = true; + compilerInstance.getDiagnosticOpts().ErrorLimit = 0; std::unique_ptr Input = llvm::MemoryBuffer::getMemBuffer(m_fileContent); compilerInstance.getPreprocessorOpts().addRemappedFile(m_filePath, Input.release()); diff --git a/src/tools/clangrefactoringbackend/source/symbolscollector.cpp b/src/tools/clangrefactoringbackend/source/symbolscollector.cpp index 1ceb4a14ce6..188d6fd2077 100644 --- a/src/tools/clangrefactoringbackend/source/symbolscollector.cpp +++ b/src/tools/clangrefactoringbackend/source/symbolscollector.cpp @@ -27,6 +27,7 @@ #include #include +#include namespace ClangBackEnd { @@ -100,6 +101,7 @@ newFrontendActionFactory(Factory *consumerFactory, bool BeginInvocation(clang::CompilerInstance &compilerInstance) override { compilerInstance.getLangOpts().DelayedTemplateParsing = false; + compilerInstance.getPreprocessorOpts().AllowPCHWithCompilerErrors = true; return clang::ASTFrontendAction::BeginInvocation(compilerInstance); }