It's quite easy to break the "update signature assistant" currently with input such as: myclass.h: struct MyClass { void foo(); }; myclass.cpp: #include "myclass.h" void MyClass::foo() { } This will break when: - adding a "bool" arg to the header - adding a "const" modifier to the implementation - ... Reproducible: Always Actual Results: no assistant shown Expected Results: assistant shows up and works as expected
Git commit b37f668452c3727b6a9835096d1a11f74bdb8e54 by Milian Wolff. Committed on 24/05/2016 at 21:02. Pushed by mwolff into branch '5.0'. Keep contexts alive when referenced by a problem. This fixes the signature assistant when invoked from the header. Now that we update the .cpp file when the header is changed, we lost the declarations therein if e.g. the function return type got changed. That then leads to issues in the signature assistant which relies on the DUChain data. I wonder whether we can find a more reliable way to store this data to remove such kind of hacks... Problably we will have to work with upstream clang and add FixIts for the signature assistant there somehow... Related: bug 298511 Differential Revision: https://phabricator.kde.org/D1140 M +4 -0 languages/clang/codegen/adaptsignatureassistant.cpp M +37 -7 languages/clang/duchain/builder.cpp M +15 -0 languages/clang/tests/test_assistants.cpp http://commits.kde.org/kdevelop/b37f668452c3727b6a9835096d1a11f74bdb8e54
This was fixed by Olivier Goffart upstream for clang-3.9 (thanks!). https://reviews.llvm.org/D19764