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.ICPPVariable;
+import org.eclipse.cdt.core.dom.ast.cpp.SemanticQueries;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.core.index.IndexFilter;
public void testInstanceInheritance_258745() throws Exception {
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 {};
// template<typename T1, typename T2>
for (ICPPMethod method : ClassTypeHelper.getOwnMethods(classType, point)) {
// Skip methods that don't actually belong to us, such as methods brought
// into scope via a using-declaration.
- if (method.getOwner() != classType) {
+ if (!method.getOwner().equals(classType)) {
continue;
}