diff options
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 88ebf62b96b..db5ab1a869f 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 3a11bcc11d2..ac9e42786ef 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); |