Community
Participate
Working Groups
Build Identifier: M20100909-0800 When extracted expression is of template type, the resulting variable will be declared with type name only, without template parameters. The source of the problem problem seems to be in org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateDefinition.getNameCharArray() called by org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.getQualifiedNameCharArray(IBinding) - only template name is returned Reproducible: Always Steps to Reproduce: The following sample code: template<class T> class Foo { }; Foo<int> getFoo(); int main() { getFoo(); // This line is selected return 0; } will result in proposal Foo getFoo0 = getFoo(); getFoo0; instead of Foo<int> getFoo0 = getFoo(); getFoo0;
(In reply to comment #0) > The source of the problem problem seems to be in > org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateDefinition.getNameCharArray() Provided the wrong name, the right one is org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSpecialization.getNameCharArray()
Created attachment 185984 [details] Patch incl. test cases
Fixed in HEAD an 7.0 > 20110104
*** cdt cvs genie on behalf of egraf *** Bug 331963: Extract local variable doesn't put template type parameters <a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=331963>https://bugs.eclipse.org/bugs/show_bug.cgi?id=331963</a> patch and test cases [*] ExtractLocalVariable.rts 1.3.6.3 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractLocalVariable.rts?root=Tools_Project&r1=1.3.6.2&r2=1.3.6.3 [*] DeclarationGeneratorImpl.java 1.1.2.4 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java?root=Tools_Project&r1=1.1.2.3&r2=1.1.2.4 [*] DeclarationGeneratorImpl.java 1.4 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java?root=Tools_Project&r1=1.3&r2=1.4 [*] ExtractLocalVariable.rts 1.7 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractLocalVariable.rts?root=Tools_Project&r1=1.6&r2=1.7