Created attachment 139560 [details] stderr from crash SUMMARY Clazy v1.9 compiled against LLVM/Clang 11.1.0 segfaults when parsing <QtTest> from Qt 6.1.0 with old-style-connect check enabled STEPS TO REPRODUCE 1. Install llvm@11 and qt (currently Qt 6.1.0) from Homebrew 2. Check out tag v1.9 from clazy repo 3. Compile/install clazy using CXX=/usr/local/opt/llvm@11/bin/clang++ and LLVM_ROOT=/usr/local/opt/llvm@11 4. $ export CLANGXX=/usr/local/opt/llvm@11/bin/clang++ 5. $ cd /tmp 6. $ echo "#include <QtTest>" > test.cpp 7. $ clazy -std=c++17 -iframework /usr/local/lib -isystem /usr/local/opt/qt/Frameworks/QtTest.framework/Headers -Xclang -plugin-arg-clazy -Xclang old-style-connect -c test.cpp OBSERVED RESULT Clang segfaults; stderr in attachment. EXPECTED RESULT Clang successfully compiles test.cpp SOFTWARE/OS VERSIONS macOS: 10.15.7 Qt Version: 6.1.0
can't repro on Linux/llvm-12
Created attachment 139753 [details] Preprocessed LLVM 11 test.cpp
Created attachment 139754 [details] LLVM 11 test.sh crash reproducer
I appear to get the same crash with LLVM 12.0.0 from Homebrew if I build either tag v1.9 + a29528ec87474a28258e34e7556fb38c5ba34a96 (Fix build with Clang 12) cherry-picked on top or the tip of the 1.9 branch. I've attached preprocessed .cpp and .sh files from both LLVM 11 and 12.
Created attachment 139755 [details] Preprocessed LLVM 12 test.cpp
Created attachment 139756 [details] LLVM 12 test.cpp crash reproducer
I've reproduced on macOS
Git commit 19f1254224b69cffd639b4a343866e7db2a469df by Sergio Martins. Committed on 30/06/2021 at 23:17. Pushed by smartins into branch 'master'. old-style-connect: Simplify regexp, which also fixes a crash Simplification done by Jonathan Marten. I don't understand why it fixes the crash though, but at least it's not worse. Related: bug 435615 M +1 -1 src/checks/level2/old-style-connect.cpp https://invent.kde.org/sdk/clazy/commit/19f1254224b69cffd639b4a343866e7db2a469df
Thank you for the quick fix!