Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316931 - Binding resolution behave strange on function argument names
Summary: Binding resolution behave strange on function argument names
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 7.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.0.1   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-15 11:36 EDT by Lukas Felber CLA
Modified: 2010-06-22 09:23 EDT (History)
0 users

See Also:


Attachments
testcase + fix (2.71 KB, patch)
2010-06-22 08:20 EDT, Markus Schorn CLA
mschorn.eclipse: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.