Skip to content

Fix test_files-clang failure with Clang 18

Igor Kushnir requested to merge work/fix-test-files-clang-v18 into release/24.05

NOTE: targeting the stable branch, because the test fix is not risky and fewer failing tests in any branch is good for development.

The test built against Clang 18.1.4 fails with the following output:

QDEBUG : TestFiles::testFiles(types.cpp) "Warning: Variable length arrays
        in C++ are a Clang extension [-Wvla-cxx-extension] in
        /builds/kdevelop/kdevelop/plugins/clang/tests/files/types.cpp:[(52,13),(52,17)]:
        <no explanation> (found by Semantic analysis)"
FAIL!  : TestFiles::testFiles(types.cpp) 'top->problems().isEmpty()' returned FALSE. ()
   Loc: [/builds/kdevelop/kdevelop/plugins/clang/tests/test_files.cpp(203)]

This is because plugins/clang/tests/files/types.cpp contains a variable length array declaration and Clang version 18 enables VLA extension warnings by default: https://github.com/llvm/llvm-project/issues/62836

Merge request reports