Community
Participate
Working Groups
I have a C++ header file that contains: template<class T1,class T2> class Temp_Class { }; template<> class Temp_Class<int,char> { }; template<> class Temp_Class<char,char> { }; I have a handle to the binding of the spec template class Temp_Class<int, char> (ICPPSpecialization) and a handle to the AST of the header file. When I call getDefinitionsInAST(binding) on the AST, the array returned contained all of the above three IASTNames in the list. The AST call should resolve and return the correct class being referred to using the binding information
Created attachment 169090 [details] testcase + fix The previous behavior was chosen to implement navigation from specializations to the template definition, see bug 92632. Navigation still works as expected, because today the navigation code deals with specializations.
Fixed in 7.0 > 20100519.
*** cdt cvs genie on behalf of mschorn *** Bug 311164: Correct getDefinitions() for specializations. [*] CPPSelectionTestsNoIndexer.java 1.30 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsNoIndexer.java?root=Tools_Project&r1=1.29&r2=1.30 [*] BaseUITestCase.java 1.35 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java?root=Tools_Project&r1=1.34&r2=1.35 [*] CPPVisitor.java 1.122 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java?root=Tools_Project&r1=1.121&r2=1.122 [*] DOMSelectionParseTest.java 1.14 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMSelectionParseTest.java?root=Tools_Project&r1=1.13&r2=1.14 [*] AST2TemplateTests.java 1.184 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java?root=Tools_Project&r1=1.183&r2=1.184 [*] IndexLocationTest.java 1.19 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexLocationTest.java?root=Tools_Project&r1=1.18&r2=1.19
Created attachment 180423 [details] follow up on the fix The fix had a negative impact on the mark occurrences feature. The patch changes the implementation such that it returns the relevant declarations for a specialization (for an explicit specialization this does not include the template).
*** cdt cvs genie on behalf of mschorn *** Bug 311164: Follow up on fix to improve mark occurrences feature. [*] CPPTemplates.java 1.120 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java?root=Tools_Project&r1=1.119&r2=1.120 [*] CPPVisitor.java 1.135 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java?root=Tools_Project&r1=1.134&r2=1.135 [*] ASTInternal.java 1.19 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTInternal.java?root=Tools_Project&r1=1.18&r2=1.19 [*] ASTTypeUtil.java 1.56 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java?root=Tools_Project&r1=1.55&r2=1.56 [*] PDOMSearchTextSelectionQuery.java 1.22 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/PDOMSearchTextSelectionQuery.java?root=Tools_Project&r1=1.21&r2=1.22 [*] IndexUI.java 1.38 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/IndexUI.java?root=Tools_Project&r1=1.37&r2=1.38