Community
Participate
Working Groups
Build Identifier: Build id: I20100312-1448 consider the following code: void foo(int i); void foo(int i) { } resolving the IASTName "i" with ast.getDeclarations(binding) in the first and the second case returns two names. But when (following code) the parameter names are different, both of them only resolve to the declaration's name "j". void foo(int i); void foo(int j) { } This is very strange since the name "i" does not even resolves to itself any more. Consequentially, both of the cases should behave in the same way. In my opinion, the names should in both cases only resolve to itself and not to the other one. Reproducible: Always
(In reply to comment #0) > Consequentially, both of the cases should behave in the same way. I agree. > In my opinion, the names should in both cases only resolve to itself and not > to the other one. That'd be simpler, however you can obtain the parameters from the function binding and we just have one function binding.
Created attachment 172408 [details] testcase + fix
Fixed in 7.0.1 and 8.0 > 20100622.
*** cdt cvs genie on behalf of mschorn *** Bug 316931: IASTTranslationUnit.getDeclarations() for parameters. [*] AST2Tests.java 1.261 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java?root=Tools_Project&r1=1.260&r2=1.261 [*] CPPVisitor.java 1.123 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.122&r2=1.123 [*] CPPVisitor.java 1.122.2.1 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.122&r2=1.122.2.1 [*] AST2Tests.java 1.258.2.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java?root=Tools_Project&r1=1.258&r2=1.258.2.1