mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 548138 - Fix override method with implementation
Change-Id: Icbea4fe97e8f3b481ea187f905661c8adcc7cc06 Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
This commit is contained in:
parent
f3e8387a8e
commit
0b9b9890ee
3 changed files with 33 additions and 4 deletions
|
@ -640,4 +640,36 @@ public class OverrideMethodsRefactoringTest extends RefactoringTestBase {
|
||||||
selectedMethods = new String[] { "baseFunc(void *)const" };
|
selectedMethods = new String[] { "baseFunc(void *)const" };
|
||||||
assertRefactoringSuccess();
|
assertRefactoringSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//A.h
|
||||||
|
//class Base {
|
||||||
|
//public:
|
||||||
|
// virtual ~Base();
|
||||||
|
// virtual void baseFunc() const {
|
||||||
|
// }
|
||||||
|
//};
|
||||||
|
//class X: public Base {
|
||||||
|
//public:
|
||||||
|
// X();
|
||||||
|
// /*$*//*$$*/
|
||||||
|
//};
|
||||||
|
//====================
|
||||||
|
//class Base {
|
||||||
|
//public:
|
||||||
|
// virtual ~Base();
|
||||||
|
// virtual void baseFunc() const {
|
||||||
|
// }
|
||||||
|
//};
|
||||||
|
//class X: public Base {
|
||||||
|
//public:
|
||||||
|
// X();
|
||||||
|
// virtual void baseFunc() const;
|
||||||
|
//};
|
||||||
|
//
|
||||||
|
//inline void X::baseFunc() const {
|
||||||
|
//}
|
||||||
|
public void testWithHeaderOnlyImpl_Bug548138() throws Exception {
|
||||||
|
selectedMethods = new String[] { "baseFunc()const" };
|
||||||
|
assertRefactoringSuccess();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.ui; singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.ui; singleton:=true
|
||||||
Bundle-Version: 6.5.0.qualifier
|
Bundle-Version: 6.5.100.qualifier
|
||||||
Bundle-Activator: org.eclipse.cdt.ui.CUIPlugin
|
Bundle-Activator: org.eclipse.cdt.ui.CUIPlugin
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
|
|
|
@ -137,9 +137,6 @@ public class Method {
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
IASTDeclarator declarator = (IASTDeclarator) declaration.getParent();
|
IASTDeclarator declarator = (IASTDeclarator) declaration.getParent();
|
||||||
IASTNode parent = declarator.getParent();
|
|
||||||
if (!(parent instanceof IASTSimpleDeclaration))
|
|
||||||
return null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We can't just copy the original nodes here but we need to create a new node. We can't do it
|
* We can't just copy the original nodes here but we need to create a new node. We can't do it
|
||||||
|
|
Loading…
Add table
Reference in a new issue