SUMMARY When testing clazy 1.8 on current Debian unstable using LLVM 9, the qt6-deprecated-api-fixes & qt6-qlatin1stringchar-to-u tests fail when run on Linux architectures (at least on x86_64 and i386). STEPS TO REPRODUCE 1. build clazy on a Linux architecture using LLVM 9 2. run the test suite, either from the build directory, or after installation OBSERVED RESULT Qt version: 51501 Qt headers: /usr/include/i386-linux-gnu/qt5 clang -Xclang -load -Xclang ClazyPlugin.so -Xclang -add-plugin -Xclang clazy -Wno-unused-value -Qunused-arguments -std=c++14 -isystem /usr/include/i386-linux-gnu/qt5 -fPIC -L /usr/lib/i386-linux-gnu -c -Xclang -plugin-arg-clazy -Xclang isempty-vs-count isempty-vs-count/main.cpp Running: clang -Xclang -load -Xclang ClazyPlugin.so -Xclang -add-plugin -Xclang clazy -Wno-unused-value -Qunused-arguments -std=c++14 -isystem /usr/include/i386-linux-gnu/qt5 -fPIC -L /usr/lib/i386-linux-gnu -c -Xclang -plugin-arg-clazy -Xclang qt6-deprecated-api-fixes -Xclang -plugin-arg-clazy -Xclang export-fixes qt6-deprecated-api-fixes/main.cpp output_file=qt6-deprecated-api-fixes/main.cpp.out [FAIL] qt6-deprecated-api-fixes (plugin) diff -Naur --strip-trailing-cr qt6-deprecated-api-fixes/main.cpp.expected qt6-deprecated-api-fixes/main.cpp.result --- qt6-deprecated-api-fixes/main.cpp.expected 2020-11-22 14:30:50.000000000 +0000 +++ qt6-deprecated-api-fixes/main.cpp.result 2020-11-23 13:55:44.805401909 +0000 @@ -1,5 +1,5 @@ qt6-deprecated-api-fixes/main.cpp:38:22: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] -qt6-deprecated-api-fixes/main.cpp:167:35: warning: non-void function does not return a value [-Wreturn-type] +qt6-deprecated-api-fixes/main.cpp:167:35: warning: control reaches end of non-void function [-Wreturn-type] qt6-deprecated-api-fixes/main.cpp:29:9: warning: function setPath() has to be used in Qt6 [-Wclazy-qt6-deprecated-api-fixes] qt6-deprecated-api-fixes/main.cpp:32:10: warning: function setPath() has to be used in Qt6 [-Wclazy-qt6-deprecated-api-fixes] qt6-deprecated-api-fixes/main.cpp:35:10: warning: function setPath() has to be used in Qt6 [-Wclazy-qt6-deprecated-api-fixes] Qt version: 51501 Qt headers: /usr/include/i386-linux-gnu/qt5 clang -Xclang -load -Xclang ClazyPlugin.so -Xclang -add-plugin -Xclang clazy -Wno-unused-value -Qunused-arguments -std=c++14 -isystem /usr/include/i386-linux-gnu/qt5 -fPIC -L /usr/lib/i386-linux-gnu -c -Xclang -plugin-arg-clazy -Xclang qstring-allocations,foreach clazy/suppressionsWholeFile.cpp Running: clang -Xclang -load -Xclang ClazyPlugin.so -Xclang -add-plugin -Xclang clazy -Wno-unused-value -Qunused-arguments -std=c++14 -isystem /usr/include/i386-linux-gnu/qt5 -fPIC -L /usr/lib/i386-linux-gnu -c -Xclang -plugin-arg-clazy -Xclang qt6-qlatin1stringchar-to-u -Xclang -plugin-arg-clazy -Xclang export-fixes qt6-qlatin1stringchar-to-u/main.cpp output_file=qt6-qlatin1stringchar-to-u/main.cpp.out [FAIL] qt6-qlatin1stringchar-to-u (plugin) diff -Naur --strip-trailing-cr qt6-qlatin1stringchar-to-u/main.cpp.expected qt6-qlatin1stringchar-to-u/main.cpp.result --- qt6-qlatin1stringchar-to-u/main.cpp.expected 2020-11-22 14:30:50.000000000 +0000 +++ qt6-qlatin1stringchar-to-u/main.cpp.result 2020-11-23 13:57:11.841399837 +0000 @@ -6,6 +6,8 @@ qt6-qlatin1stringchar-to-u/main.cpp:27:20: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u] qt6-qlatin1stringchar-to-u/main.cpp:30:24: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u] qt6-qlatin1stringchar-to-u/main.cpp:30:42: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u] +qt6-qlatin1stringchar-to-u/main.cpp:30:24: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u] +qt6-qlatin1stringchar-to-u/main.cpp:30:42: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u] qt6-qlatin1stringchar-to-u/main.cpp:31:16: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u] qt6-qlatin1stringchar-to-u/main.cpp:34:16: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u] qt6-qlatin1stringchar-to-u/main.cpp:36:27: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u] EXPECTED RESULT qt6-deprecated-api-fixes & qt6-qlatin1stringchar-to-u pass on any architecture. SOFTWARE/OS VERSIONS Qt Version: 5.15.2 LLVM: 9
Sorry, I typo'ed the Qt version, which is 5.15.1 (as also visible in the snippets).
I just tried with LLVM 11, and these two tests pass.
Git commit 04d38721ba951a9cafd276d584880d3f72c7794a by Sergio Martins. Committed on 23/11/2020 at 16:05. Pushed by smartins into branch '1.8'. qt6-deprecated-api-fixes: Remove unrelated warnings from the test There was a stray/unrelated compiler warning in the expected dataset. Can make the test fail if some other compiler is used and gives a different message M +1 -1 tests/qt6-deprecated-api-fixes/main.cpp M +0 -1 tests/qt6-deprecated-api-fixes/main.cpp.expected M +1 -1 tests/qt6-deprecated-api-fixes/main.cpp.fixed.expected https://invent.kde.org/sdk/clazy/commit/04d38721ba951a9cafd276d584880d3f72c7794a
Git commit c1dc65494574227646e1dd36675a5bd906660647 by Sergio Martins. Committed on 23/11/2020 at 16:31. Pushed by smartins into branch '1.8'. qt6-qlatin1stringchar-to-u: Only run tests with clang 11 It's flaky with other versions. Not disabling the check since it still works, just warns twice for the same line. CCMAIL: lucie.gerard@qt.io M +2 -1 tests/qt6-qlatin1stringchar-to-u/config.json https://invent.kde.org/sdk/clazy/commit/c1dc65494574227646e1dd36675a5bd906660647
Thanks for the quick fixes! I can indeed confirm they work on both LLVM 9 and 11. PS: the clazy 1.8 tar.gz does not have the content inside a top-level directory like clazy-1.8, unlike previous versions (and generally released Linux software).