1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

Bug 258745.

This commit is contained in:
Sergey Prigogin 2008-12-15 01:50:45 +00:00
parent fac46c70c2
commit 78b78b4812
2 changed files with 9 additions and 3 deletions

View file

@ -528,7 +528,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// void test() {
// B<int>::a;
// }
public void _testInstanceInheritance_258745() throws Exception {
public void testInstanceInheritance_258745() throws Exception {
getBindingFromASTName("a", 1, ICPPField.class);
}

View file

@ -37,6 +37,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDirective;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
@ -847,9 +848,14 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
super.onCreateName(file, name, pdomName);
IASTNode parentNode= name.getParent();
IASTNode nameNode = name;
if (name.getPropertyInParent() == ICPPASTTemplateId.TEMPLATE_NAME &&
parentNode.getParent() instanceof ICPPASTQualifiedName) {
nameNode = parentNode;
parentNode = parentNode.getParent();
}
if (parentNode instanceof ICPPASTQualifiedName) {
IASTName[] ns = ((ICPPASTQualifiedName) parentNode).getNames();
if (name != ns[ns.length - 1]) {
if (nameNode != ((ICPPASTQualifiedName) parentNode).getLastName()) {
return;
}
parentNode = parentNode.getParent();