summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-12-22 04:01:46 (EST)
committerSergey Prigogin2013-12-23 14:08:13 (EST)
commit628e0329b259dfd307cd87dd0cf807b06dd04288 (patch)
treebec4901e20a06fcdb80882833e604613f9b10f5e
parent80d5db77489dd8d0e6f1e5c6ab6fb9ad788c353a (diff)
downloadorg.eclipse.cdt-628e0329b259dfd307cd87dd0cf807b06dd04288.zip
org.eclipse.cdt-628e0329b259dfd307cd87dd0cf807b06dd04288.tar.gz
org.eclipse.cdt-628e0329b259dfd307cd87dd0cf807b06dd04288.tar.bz2
Bug 326750 - Field with same name as classrefs/changes/47/20147/2
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>
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java2
2 files changed, 12 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
index 88ebf62..db5ab1a 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
@@ -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();
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java
index 3a11bcc..ac9e427 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java
@@ -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);