Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316931

Summary: Binding resolution behave strange on function argument names
Product: [Tools] CDT Reporter: Lukas Felber <l.felber>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3    
Version: 7.0   
Target Milestone: 7.0.1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
testcase + fix mschorn.eclipse: iplog-

Description Lukas Felber CLA 2010-06-15 11:36:55 EDT
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
Comment 1 Markus Schorn CLA 2010-06-22 07:48:12 EDT
(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.
Comment 2 Markus Schorn CLA 2010-06-22 08:20:34 EDT
Created attachment 172408 [details]
testcase + fix
Comment 3 Markus Schorn CLA 2010-06-22 08:21:01 EDT
Fixed in 7.0.1 and 8.0 > 20100622.