Community
Participate
Working Groups
When renaming a template all specializations have to be renamed, too. This works only when a template-id is used to name a instance, it does not work for specializations. See bug 240589 for a code snippet.
Here's a test case that seems to show the problem, as I understand it. https://git.eclipse.org/r/11064 The code is: template <class T> class CSome { public: void Foo () {}; //Rename run here. }; int main () { CSome <int> A; A.Foo(); return 0; } Looking into it, it seems like the problem is that the first reference is given the AST type CPPMethod, but the 2nd is CPPMethodSpecialization, which, while they share some interfaces, they are not recongized by org.eclipse.cdt.internal.ui.refactoring.rename.ASTManager.fKnownBindings as being the same. This causes org.eclipse.cdt.internal.ui.refactoring.rename.ASTManager.analyzeAstTextMatchPair(CRefactoringMatch, IASTName, RefactoringStatus) to assign the 2nd one the CRefactoringMatch.AST_REFERENCE_OTHER status, which causes it to be ignored. I'm not yet sure how this should be fixed...
Looking into it more, the place where CPPMethodSpecialization and CPPMethod are seen as non-matching is in org.eclipse.cdt.internal.ui.refactoring.rename.ASTManager.isSameBinding(IIndex, IBinding, IBinding) , specifically within org.eclipse.cdt.internal.ui.refactoring.rename.ASTManager.isSameScope(IScope, IScope, boolean) where the names of the two scopes don't match (since one has the template parameter filled in). I'm not sure what should be changed within there to make them match...
*** Bug 316567 has been marked as a duplicate of this bug. ***