Bug 373452 - Renaming class doesn't rename destructor
Summary: Renaming class doesn't rename destructor
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: 5.0.4
Assignee: kdevelop-bugs-null
URL: https://phabricator.kde.org/D4098
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-09 05:47 UTC by Nicolás Alvarez
Modified: 2017-01-16 09:04 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.4


Attachments
Rename dialog (9.81 KB, image/png)
2016-12-09 05:47 UTC, Nicolás Alvarez
Details

Note You need to log in before you can comment on or make changes to this bug.
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