mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 04:55:22 +02:00
Bug 480892 - Compare bindings by value equality during final overrider
analysis Change-Id: I6a530710bdd5ea029726f8ed42e8a3c11f39996b Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
parent
927dd7502d
commit
e9800bd4a1
2 changed files with 21 additions and 1 deletions
|
@ -55,6 +55,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameterMap;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTemplateParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTypeParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTypeParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.SemanticQueries;
|
||||||
import org.eclipse.cdt.core.index.IIndex;
|
import org.eclipse.cdt.core.index.IIndex;
|
||||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||||
import org.eclipse.cdt.core.index.IndexFilter;
|
import org.eclipse.cdt.core.index.IndexFilter;
|
||||||
|
@ -610,6 +611,25 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
|
||||||
getBindingFromFirstIdentifier("a", ICPPField.class);
|
getBindingFromFirstIdentifier("a", ICPPField.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template <typename>
|
||||||
|
// struct Base {
|
||||||
|
// virtual void foo() = 0;
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// struct Derived : Base<int> {
|
||||||
|
// virtual void foo();
|
||||||
|
// };
|
||||||
|
|
||||||
|
// Derived waldo;
|
||||||
|
public void testMethodOveriddenFromTemplateInstanceBase_480892() throws Exception {
|
||||||
|
IVariable waldo = getBindingFromFirstIdentifier("waldo");
|
||||||
|
IType derived = waldo.getType();
|
||||||
|
assertInstance(derived, ICPPClassType.class);
|
||||||
|
ICPPClassType derivedClass = (ICPPClassType) derived;
|
||||||
|
ICPPMethod[] pureVirtualMethods = SemanticQueries.getPureVirtualMethods(derivedClass, null);
|
||||||
|
assertEquals(0, pureVirtualMethods.length);
|
||||||
|
}
|
||||||
|
|
||||||
// class A {}; class B {}; class C {};
|
// class A {}; class B {}; class C {};
|
||||||
// template<typename T1, typename T2>
|
// template<typename T1, typename T2>
|
||||||
// class D {};
|
// class D {};
|
||||||
|
|
|
@ -252,7 +252,7 @@ public class CPPInheritance {
|
||||||
for (ICPPMethod method : ClassTypeHelper.getOwnMethods(classType, point)) {
|
for (ICPPMethod method : ClassTypeHelper.getOwnMethods(classType, point)) {
|
||||||
// Skip methods that don't actually belong to us, such as methods brought
|
// Skip methods that don't actually belong to us, such as methods brought
|
||||||
// into scope via a using-declaration.
|
// into scope via a using-declaration.
|
||||||
if (method.getOwner() != classType) {
|
if (!method.getOwner().equals(classType)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue