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:
parent
c595624439
commit
36d621341c
2 changed files with 22 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2825,11 +2825,9 @@ public class CPPSemantics {
|
|||
if (scope == null)
|
||||
return null;
|
||||
lookup(funcData, scope);
|
||||
if (methodData == null || !methodData.hasResults()) {
|
||||
try {
|
||||
doKoenigLookup(funcData);
|
||||
} catch (DOMException e) {
|
||||
}
|
||||
try {
|
||||
doKoenigLookup(funcData);
|
||||
} catch (DOMException e) {
|
||||
}
|
||||
}
|
||||
} catch (DOMException e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue