Bug 373452

Summary: Renaming class doesn't rename destructor
Product: [Applications] kdevelop Reporter: Nicolás Alvarez <nalvarez>
Component: Language Support: CPP (Clang-based)Assignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: kfunk
Priority: NOR    
Version First Reported In: git master   
Target Milestone: 5.0.4   
Platform: Other   
OS: Linux   
URL: https://phabricator.kde.org/D4098
Latest Commit: Version Fixed/Implemented In: 5.0.4
Sentry Crash Report:
Attachments: Rename dialog

Description Nicolás Alvarez 2016-12-09 05:47:35 UTC
Created attachment 102697 [details]
Rename dialog

If I rename a class, the constructor is also renamed, but the destructor isn't and the result doesn't compile. Strangely, the rename dialog looks as if it was going to rename the destructor too, but then it doesn't.

Code:

class Foo {
public:
    Foo();
    ~Foo();
};

Foo::Foo() {
}

Foo::~Foo() {
}


Right-click on the class name, select "Rename Foo". The dialog looks like it's going to rename the destructor (screenshot attached). However, once I actually click the Rename button, I get this:

class Bar {
public:
    Bar();
    ~Foo();
};

Bar::Bar() {
}

Bar::~Foo() {
}
Comment 1 Kevin Funk 2017-01-16 09:04:27 UTC
Git commit 51658b81204090690ccecc682ef4b064f959d09f by Kevin Funk.
Committed on 13/01/2017 at 08:01.
Pushed by kfunk into branch '5.0'.

Clang: Also rename destructors when renaming class

Summary:
FIXED-IN: 5.0.4

Subscribers: kdevelop-devel

Differential Revision: https://phabricator.kde.org/D4098

M  +55   -0    languages/clang/codegen/clangrefactoring.cpp
M  +7    -0    languages/clang/codegen/clangrefactoring.h
M  +8    -0    languages/clang/tests/CMakeLists.txt
A  +143  -0    languages/clang/tests/test_refactoring.cpp     [License: GPL (v2/3)]
C  +16   -23   languages/clang/tests/test_refactoring.h [from: languages/clang/codegen/clangrefactoring.h - 053% similarity]

https://commits.kde.org/kdevelop/51658b81204090690ccecc682ef4b064f959d09f