mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-02 22:05:44 +02:00
Bug 258745.
This commit is contained in:
parent
fac46c70c2
commit
78b78b4812
2 changed files with 9 additions and 3 deletions
|
@ -528,7 +528,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
|
||||||
// void test() {
|
// void test() {
|
||||||
// B<int>::a;
|
// B<int>::a;
|
||||||
// }
|
// }
|
||||||
public void _testInstanceInheritance_258745() throws Exception {
|
public void testInstanceInheritance_258745() throws Exception {
|
||||||
getBindingFromASTName("a", 1, ICPPField.class);
|
getBindingFromASTName("a", 1, ICPPField.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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.ICPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
|
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.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.ICPPASTUsingDirective;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
|
@ -847,9 +848,14 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
||||||
super.onCreateName(file, name, pdomName);
|
super.onCreateName(file, name, pdomName);
|
||||||
|
|
||||||
IASTNode parentNode= name.getParent();
|
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) {
|
if (parentNode instanceof ICPPASTQualifiedName) {
|
||||||
IASTName[] ns = ((ICPPASTQualifiedName) parentNode).getNames();
|
if (nameNode != ((ICPPASTQualifiedName) parentNode).getLastName()) {
|
||||||
if (name != ns[ns.length - 1]) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
parentNode = parentNode.getParent();
|
parentNode = parentNode.getParent();
|
||||||
|
|
Loading…
Add table
Reference in a new issue