1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Additional fix for bug 259680.

This commit is contained in:
Sergey Prigogin 2008-12-26 06:32:06 +00:00
parent f707b944ef
commit 01d2201caa
2 changed files with 15 additions and 7 deletions

View file

@ -6135,12 +6135,12 @@ public class AST2CPPTests extends AST2BaseTest {
ba.assertProblem("a; // should not resolve", 1);
}
}
// namespace ns {
// template<typename T> class CT {};
// }
// using ns::CT<int>;
public void testTemplateIDInUsingDecl_251199() throws Exception {
public void testTemplateIdInUsingDecl_251199() throws Exception {
parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP);
}
@ -6157,7 +6157,7 @@ public class AST2CPPTests extends AST2BaseTest {
bh.assertNonProblem("operator ns::A", 14);
parseAndCheckBindings(code, ParserLanguage.CPP);
}
// void f();
//
// void test(int p) {
@ -6315,15 +6315,20 @@ public class AST2CPPTests extends AST2BaseTest {
}
// struct A {
// int operator*() { return 0; }
// int& operator*();
// const int& operator*() const;
// };
// void func(int p) {}
// void func(int& p) {}
// void func(const int& p) {}
//
// void test(A& a) {
// void test(A& a, const A& b) {
// func(*a);
// func(*b);
// }
public void testSmartPointerReference_259680() throws Exception {
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
ba.assertNonProblem("func(*a)", 4, ICPPFunction.class);
ICPPFunction f1= ba.assertNonProblem("func(*a)", 4, ICPPFunction.class);
ICPPFunction f2= ba.assertNonProblem("func(*b)", 4, ICPPFunction.class);
assertNotSame(f1, f2);
}
}

View file

@ -1954,6 +1954,9 @@ public class CPPVisitor extends ASTQueries {
if (type instanceof ICPPReferenceType) {
type = ((ICPPReferenceType) type).getType();
}
if (type instanceof IQualifierType) {
type = ((IQualifierType) type).getType();
}
if (type instanceof ICPPClassType) {
ICPPFunction operator= CPPSemantics.findOperator(expression, (ICPPClassType) type);
if (operator != null) {