Bug 358479 - update signature assistant broken
Summary: update signature assistant broken
Status: RESOLVED UPSTREAM
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: git master
Platform: Other Linux
: NOR major
Target Milestone: 5.0.0
Assignee: kdevelop-bugs-null
URL:
Keywords: release_blocker
Depends on:
Blocks:
 
Reported: 2016-01-24 13:56 UTC by Milian Wolff
Modified: 2016-09-06 09:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milian Wolff 2016-01-24 13:56:33 UTC
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
Comment 1 Milian Wolff 2016-05-24 21:03:03 UTC
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
Comment 2 Milian Wolff 2016-09-06 09:53:26 UTC
This was fixed by Olivier Goffart upstream for clang-3.9 (thanks!).

https://reviews.llvm.org/D19764