https://bugs.kde.org/show_bug.cgi?id=375276

            Bug ID: 375276
           Summary: "Update declaration signature" on a constructor adds a
                    return type to it
           Product: kdevelop
           Version: git master
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: Language Support: CPP (Clang-based)
          Assignee: kdevelop-bugs-n...@kde.org
          Reporter: nicolas.alva...@gmail.com
  Target Milestone: ---

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.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to