1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 09:15:38 +02:00

Bug 326750 - Field with same name as class

Change-Id: I6170ad204506d9eca3a0016930ad6506ba56e9cd
Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
Reviewed-on: https://git.eclipse.org/r/20147
Tested-by: Hudson CI
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
Nathan Ridge 2013-12-22 04:01:46 -05:00 committed by Sergey Prigogin
parent 80d5db7748
commit 628e0329b2
2 changed files with 12 additions and 2 deletions

View file

@ -10467,4 +10467,16 @@ public class AST2CPPTests extends AST2TestBase {
public void testBuiltInOperatorFunctionType_423396() throws Exception {
parseAndCheckBindings();
}
// struct S {
// int S;
// };
// void tint(int);
// void test() {
// S s;
// tint(s.S);
// }
public void testFieldWithSameNameAsClass_326750() throws Exception {
parseAndCheckBindings();
}
}

View file

@ -257,8 +257,6 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
}
//9.2 ... The class-name is also inserted into the scope of the class itself
result = ArrayUtil.append(IBinding.class, result, compName.resolveBinding());
if (!prefixLookup)
return ArrayUtil.trim(IBinding.class, result);
}
result = ArrayUtil.addAll(IBinding.class, result, super.getBindings(lookup));
return ArrayUtil.trim(IBinding.class, result);