Community
Participate
Working Groups
Build Identifier: M20100909-0800 The indexer seems to have problems while resolving template-ids of type X<void()> if the template definition look like this: template<typename T> class X; template<typename T> class X<T (void)> { }; the template-id resolves to the first X instead of to the second one. When changing the template-id to resolve to X<void(void)> or the second definition to "template<typename T> class X<T ()> { };" ("void" removed), the indexer is able to resolve the template-id correctly. I think that, according to the C++ standard 8.3.5, void(void) and void() should be treated equivalently. is that correct? Reproducible: Always Steps to Reproduce: 1. open source file containing: template<typename T> class X; template<typename T> class X<T (void)> { }; int main() { X<void()> f; } 2. ctrl+click on the template-id X<void()>. This sets the selection to X on code line 1 instead of X on code line 2.
Created attachment 191985 [details] testcase + fix
Fixed in 8.0.
*** cdt cvs genie on behalf of mschorn *** Bug 339977: void f(void) in template argument deduction. [*] AST2TemplateTests.java 1.210 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.209&r2=1.210 [*] TemplateArgumentDeduction.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/cpp/semantics/TemplateArgumentDeduction.java?root=Tools_Project&r1=1.18&r2=1.19 [*] SemanticUtil.java 1.53 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/SemanticUtil.java?root=Tools_Project&r1=1.52&r2=1.53 [*] CPPFunctionType.java 1.18 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionType.java?root=Tools_Project&r1=1.17&r2=1.18