1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 259683.

This commit is contained in:
Sergey Prigogin 2008-12-27 18:39:00 +00:00
parent a443b1fafc
commit e098f7ccf6
2 changed files with 17 additions and 2 deletions

View file

@ -1048,6 +1048,18 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
getBindingFromASTName("func(q", 4, ICPPFunction.class);
}
// class A {
// class B;
// };
// class A::B {
// void m();
// };
// void A::B::m() {}
public void testNestedClasses_Bug259683() throws Exception {
getBindingFromASTName("A::B::m", 7, ICPPMethod.class);
}
private void assertBindings(String[] expected, ICPPBase[] bases) throws DOMException {
IBinding[] bindings= new IBinding[bases.length];
for (int i = 0; i < bindings.length; i++) {

View file

@ -177,7 +177,7 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
public CPPClassType(IASTName name, IBinding indexBinding) {
if (name instanceof ICPPASTQualifiedName) {
IASTName[] ns = ((ICPPASTQualifiedName)name).getNames();
IASTName[] ns = ((ICPPASTQualifiedName) name).getNames();
name = ns[ns.length - 1];
}
IASTNode parent = name.getParent();
@ -430,7 +430,10 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
}
public IBinding getOwner() throws DOMException {
return CPPVisitor.findDeclarationOwner(definition != null ? definition : declarations[0], true);
if (definition != null) {
return CPPVisitor.findNameOwner(definition, true);
}
return CPPVisitor.findDeclarationOwner(declarations[0], true);
}
public boolean isAnonymous() throws DOMException {