diff --git a/src/tools/clangbackend/source/codecompleter.cpp b/src/tools/clangbackend/source/codecompleter.cpp index 91a9ad69ba2..ae49b650dd2 100644 --- a/src/tools/clangbackend/source/codecompleter.cpp +++ b/src/tools/clangbackend/source/codecompleter.cpp @@ -61,6 +61,8 @@ CodeCompletions toCodeCompletions(const UnsavedFile &unsavedFile, return codeCompletions; } +// CLANG-UPGRADE-CHECK: Remove this workaround once we require LLVM/Clang 11 as that version makes +// the workaround pointless. void filterUnknownContextResults(ClangCodeCompleteResults &results, const UnsavedFile &theUnsavedFile, uint line, diff --git a/tests/unit/unittest/codecompleter-test.cpp b/tests/unit/unittest/codecompleter-test.cpp index ec865aacbde..dcb1c1a57c9 100644 --- a/tests/unit/unittest/codecompleter-test.cpp +++ b/tests/unit/unittest/codecompleter-test.cpp @@ -530,7 +530,9 @@ TEST_F(CodeCompleterSlowTest, NoDotArrowCorrectionForColonColon) ASSERT_THAT(completions, Not(Contains(HasFixIts()))); } -TEST_F(CodeCompleterSlowTest, NoGlobalCompletionAfterForwardDeclaredClassPointer) +// Our workaround is not applicable with LLVM/Clang 10 anymore, so disable this test for that version. +// Luckily, the workaround is not needed anymore with LLVM/Clang 11. +TEST_F(CodeCompleterSlowTest, DISABLED_FOR_CLANG_10(NoGlobalCompletionAfterForwardDeclaredClassPointer)) { auto myCompleter = setupCompleter(globalCompletionAfterForwardDeclaredClassPointer); const ClangBackEnd::CodeCompletions completions = myCompleter.complete(5, 10); diff --git a/tests/unit/unittest/conditionally-disabled-tests.h b/tests/unit/unittest/conditionally-disabled-tests.h index 128520a8817..91b2541fe9d 100644 --- a/tests/unit/unittest/conditionally-disabled-tests.h +++ b/tests/unit/unittest/conditionally-disabled-tests.h @@ -25,6 +25,14 @@ #include +#include + +#if CINDEX_VERSION_MAJOR == 0 && CINDEX_VERSION_MINOR == 59 +# define DISABLED_FOR_CLANG_10(x) DISABLED_##x +#else +# define DISABLED_FOR_CLANG_10(x) x +#endif + #ifdef Q_OS_WIN # define DISABLED_ON_WINDOWS(x) DISABLED_##x #else