Bug 375277

Summary: Some changes trigger unnecessary "update declaration" hint on constructor
Product: [Applications] kdevelop Reporter: Nicolás Alvarez <nalvarez>
Component: Language Support: CPP (Clang-based)Assignee: kdevelop-bugs-null
Status: RESOLVED DUPLICATE    
Severity: normal CC: kilo, master.haber, shashwatdixit124
Priority: NOR    
Version First Reported In: 5.1.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Nicolás Alvarez 2017-01-19 04:41:34 UTC
Start with the following code:
class Foo {
    Foo();
};
Foo::Foo() 
{
    ;
}

Wait for parsing to finish and everything to get highlighted. Now add a space(!) after the constructor's definition prototype:

Foo::Foo() <-- add a space here
{
    ;
}

The modified line is now underlined in red, and the tooltip shows "Problem in Semantic analysis: Adapt Signature" and offers to "Update declaration signature", even though there was no actual change to the signature. (Selecting this solution then triggers bug 375276 and makes the code invalid).
Comment 1 Ian H 2017-01-19 14:20:41 UTC
This also happens if you add another line of instantiation outside of the brackets.

header: int bar;

cpp file:

class Foo: 
bar(0)
{
}

adding the bar(0) will also do the update declaration signature thing.
Comment 2 Nicolás Alvarez 2017-01-19 20:22:58 UTC
Yes, that's where I noticed it initially; then I noticed a simple space was enough to trigger it.
Comment 3 KiloAlphaIndia 2017-03-24 09:37:22 UTC
I can confirm this.
Comment 4 shashwat 2018-03-16 09:22:18 UTC
Can't Reproduce 
I think fixed in commit https://phabricator.kde.org/R32:e334d754bf510bdf21368858d8494adf3622fb16
Comment 5 Kevin Funk 2018-03-19 17:20:04 UTC
Sounds sane to me. Marking as duplicate.

*** This bug has been marked as a duplicate of bug 365420 ***