Bug 375276 - "Update declaration signature" on a constructor adds a return type to it
Summary: "Update declaration signature" on a constructor adds a return type to it
Status: RESOLVED DUPLICATE of bug 365420
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: 5.1.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-19 04:29 UTC by Nicolás Alvarez
Modified: 2017-03-04 20:09 UTC (History)
2 users (show)

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 Nicolás Alvarez 2017-01-19 04:29:56 UTC
Start with the following code:

class MyClass {
    MyClass();
};
MyClass::MyClass() {
    ;
}

Now add an argument to the definition of the constructor:

MyClass::MyClass(int x) {

For now, this makes the code invalid, because the declaration and definition don't match. The definition prototype is underlined in red. Moving mouse over it shows "Problem in Semantic analysis: Out-of-line definition of 'MyClass' does not match any declaration in 'MyClass'" and offers "Update declaration signature" as a solution.

If I activate the offered solution, the declaration is changed to this:

class MyClass {
    void MyClass(int x);
};

Despite being a constructor, it added a 'void' return type, making the code even more invalid than it was.
Comment 1 KiloAlphaIndia 2017-03-03 09:06:26 UTC
I assume this is the same as bug 365420
Comment 2 Kevin Funk 2017-03-03 12:01:46 UTC
True. Thanks!

*** This bug has been marked as a duplicate of bug 365420 ***
Comment 3 Piotr Mierzwinski 2017-03-04 19:53:10 UTC
Bug 365420 is related with line 5.0.x, because was reported before branch 5.1 started.
Anyway issue reported in bug 365420 is still present in the newest stable KDevelop version. I mean 5.0.4 (announced today).
Choosing "Solution (1): Update declaration signature" makes that "void" is added in constructor declaration.

I wonder why this bug is marked as "RESOLVED". I'm not able to find any commit fixing this bug in branch 5.1 - neither in kdevelop nor in kdevplatform. To searching I used cgit weblient. I searched "log msg" using "search" button.
Or "RESOLVED DUPLICATE of bug 365420" means that only 365420 is fixed, because is duplicate of this (despite that this one is newer).
Comment 4 Nicolás Alvarez 2017-03-04 20:06:37 UTC
"RESOLVED DUPLICATE" just means this ticket is closed because it's a duplicate. The problem still exists and progress on it will be tracked in bug 365420.
Comment 5 Piotr Mierzwinski 2017-03-04 20:09:20 UTC
Sorry for misunderstanding.