diff --git a/languages/clang/duchain/parsesession.cpp b/languages/clang/duchain/parsesession.cpp --- a/languages/clang/duchain/parsesession.cpp +++ b/languages/clang/duchain/parsesession.cpp @@ -149,7 +149,11 @@ , m_unit(nullptr) { unsigned int flags = CXTranslationUnit_CXXChainedPCH - | CXTranslationUnit_DetailedPreprocessingRecord; + | CXTranslationUnit_DetailedPreprocessingRecord +#if CINDEX_VERSION_MINOR >= 34 + | CXTranslationUnit_KeepGoing +#endif + ; if (options.testFlag(SkipFunctionBodies)) { flags |= CXTranslationUnit_SkipFunctionBodies; } diff --git a/languages/clang/tests/test_duchain.cpp b/languages/clang/tests/test_duchain.cpp --- a/languages/clang/tests/test_duchain.cpp +++ b/languages/clang/tests/test_duchain.cpp @@ -281,7 +281,9 @@ QVERIFY(headerCtx); QCOMPARE(headerCtx->url(), header.url()); +#if CINDEX_VERSION_MINOR < 34 QEXPECT_FAIL("", "Second missing header isn't reported", Continue); +#endif QCOMPARE(headerCtx->problems().count(), 2); QCOMPARE(headerCtx->localDeclarations().count(), 2); @@ -292,11 +294,20 @@ auto b = dynamic_cast(headerCtx->localDeclarations().last()); QVERIFY(b); +#if CINDEX_VERSION_MINOR < 34 QEXPECT_FAIL("", "Base class isn't assigned correctly", Continue); +#endif QCOMPARE(b->baseClassesSize(), 1u); +#if CINDEX_VERSION_MINOR < 34 // at least the one problem we have should have been propagated QCOMPARE(top->problems().count(), 1); +#else + // two errors: + // /tmp/testfile_f32415.h:3:10: error: 'missing1.h' file not found + // /tmp/testfile_f32415.h:11:10: error: 'missing2.h' file not found + QCOMPARE(top->problems().count(), 2); +#endif } QByteArray createCode(const QByteArray& prefix, const int functions)