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

Bug 296906: ADL for overloaded operators.

This commit is contained in:
Markus Schorn 2009-12-10 10:07:29 +00:00
parent c595624439
commit 36d621341c
2 changed files with 22 additions and 5 deletions

View file

@ -7966,5 +7966,24 @@ public class AST2CPPTests extends AST2BaseTest {
bh.assertProblem("sink3(z7)", 5);
}
// struct A {};
// namespace ns {
// struct C {
// int operator+(int);
// };
// int operator+(const C&, const A&);
// }
//
// void check(int);
// int main(int argc, char** argv) {
// A a;
// ns::C c;
// check(c+1);
// check(c+a);
// }
public void testADLForOperators_296906() throws Exception {
String code= getAboveComment();
parseAndCheckBindings(code, ParserLanguage.CPP);
}
}

View file

@ -2825,13 +2825,11 @@ public class CPPSemantics {
if (scope == null)
return null;
lookup(funcData, scope);
if (methodData == null || !methodData.hasResults()) {
try {
doKoenigLookup(funcData);
} catch (DOMException e) {
}
}
}
} catch (DOMException e) {
return null;
}