Created attachment 121371 [details] File attempting to produce a reduced form of the bug (failed) SUMMARY Adding a lambda as a template argument in a specific project (of mine) causes a crash when trying to parse a file. STEPS TO REPRODUCE 1. Download the project via `git clone https://gitlab.com/TheEdenCrazy/correlative-neural-network.git`, `git checkout e8861a831819b858f9792570b8aebe9b2641b06b` 2. Open in kdevelop, making sure to set the C++ parser to C++17 (I don't know if the bug is c++-version-dependent but this should replicate it). 3. Add `_impl_add_t<&neuron_index::idx, [](){}> v;` to the file at "correlative-neural-network/library/include/cnn/storeprotodef/field_encode_gen.hpp", as a member of the template struct `_impl_FieldEncodingGenerator`, after the templates. OBSERVED RESULT KDevelop crashes with a segfault after producing the following on the console: QProcess: Destroyed while process ("clang") is still running. kdevplatform.shell: process finished with error: QProcess::Crashed QProcess: Destroyed while process ("clang") is still running. kdevplatform.shell: process finished with error: QProcess::Crashed kdevelop.plugins.clang: Unhandled type: Dependent <dependent type> kdevelop.plugins.clang: Unhandled type: Dependent <dependent type> kdevelop.plugins.clang: Unhandled type: Dependent <dependent type> kdevelop.plugins.clang: Unhandled type: Dependent <dependent type> kdevelop.plugins.clang: Unhandled type: Dependent <dependent type> kdevelop.plugins.clang: Unhandled type: Dependent <dependent type> EXPECTED RESULT KDevelop does not crash, and (depending on the C++ version) there is either a syntax error or no syntax error (C++20 allows lambdas as function template arguments). SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: Manjaro (latest update) (available in About System) KDE Plasma Version: [using xfce4-gtk3] KDE Frameworks Version: KDevelop 5.3.2 and KDevelop as built from master. Qt Version: 5.12.4 ADDITIONAL INFORMATION I downloaded the Kdevelop project and built it and examined it in a debugger. As far as I can tell, the issue is related to the parser not recognising the type as one of those processed in kdevelop/plugins/clang, builder.cpp, Visitor::makeType. I have attempted to replicate the bug by simply copy-pasting the core type structure (i.e. type-template in template in 2 namespaces), but it does not work. However, I cannot replicate it and it produces the expected behaviour. See the file I used for testing attached.
I'm working on reducing down the project to the files that generate the crash. Do: `git clone https://gitlab.com/TheEdenCrazy/cnn_kdevbug_reduce.git` and it should reproduce the bug. Also see the branches for what didn't remove the bug.
I have reduced the bug down to just a header and a main.cpp (which just imports the header). Directly pasting the header into main.cpp does not reproduce the bug. See the reduced-code repo to see exactly what code is triggering the crash.
Adding `std::cout << "Visiting cursor\n";` to the Visitor::dispatchCursor method shows that that part of code isn't even touched before the crash.
My sincere apologies! I only just realised that the repo I linked was private! You should be able to access it now.
Thank you for reporting this crash in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the crash with a recent software version? If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone!