mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-05 08:05:24 +02:00
Bug 413406 - [false negative] Ambiguous base class lookup
Change-Id: I9f81619eb40456529fbfe4ce42ced661b9f1dac2 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com> Reviewed-on: https://git.eclipse.org/r/14728 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
2accba3b07
commit
ec6fb10d7a
2 changed files with 38 additions and 0 deletions
|
@ -2364,4 +2364,23 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
|
||||||
public void testNPE_407497() throws Exception {
|
public void testNPE_407497() throws Exception {
|
||||||
checkBindings();
|
checkBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template <typename>
|
||||||
|
// struct basic_A {
|
||||||
|
// bool eof() const;
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// typedef basic_A<char> A;
|
||||||
|
|
||||||
|
// class B : public A {};
|
||||||
|
//
|
||||||
|
// class C : public A, public B {};
|
||||||
|
//
|
||||||
|
// void foo() {
|
||||||
|
// C c;
|
||||||
|
// c.eof();
|
||||||
|
// }
|
||||||
|
public void testAmbiguousBaseClassLookup_413406() throws Exception {
|
||||||
|
getProblemFromASTName("eof();", 3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,4 +275,23 @@ public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializat
|
||||||
public EScopeKind getKind() {
|
public EScopeKind getKind() {
|
||||||
return EScopeKind.eClassType;
|
return EScopeKind.eClassType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note: equals() and hashCode() are overridden because multiple instances
|
||||||
|
// of this class representing the same class specialization scope
|
||||||
|
// may be created, but scopes are sometimes stored in hash maps
|
||||||
|
// under the assumption that two objects representing the same
|
||||||
|
// scope will compare equal().
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object other) {
|
||||||
|
if (other instanceof ICPPClassSpecializationScope) {
|
||||||
|
return getClassType().equals(((ICPPClassSpecializationScope) other).getClassType());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return specialClass.hashCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue