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

Bug 334955: Overloaded comma operator with const class reference.

This commit is contained in:
Markus Schorn 2011-01-21 10:41:45 +00:00
parent d9c1b0b0c4
commit 00b07da35e
2 changed files with 12 additions and 1 deletions

View file

@ -9334,4 +9334,15 @@ public class AST2CPPTests extends AST2BaseTest {
public void testResolutionInTrailingReturnType_333256() throws Exception {
parseAndCheckBindings();
}
// struct CHAINER {
// CHAINER const & operator,(int x) const;
// };
// void test(const CHAINER& x) {
// CHAINER c;
// test((c,0,1));
// }
public void testOverloadedCommaOpWithConstClassRef_334955() throws Exception {
parseAndCheckBindings();
}
}

View file

@ -3208,7 +3208,7 @@ public class CPPSemantics {
dummy.setParent(first);
IASTExpression[] args = new IASTExpression[] { dummy , second };
return findOverloadedOperator(dummy, args, lookupType, OverloadableOperator.COMMA, LookupMode.LIMITED_GLOBALS);
return findOverloadedOperator(dummy, args, op1type, OverloadableOperator.COMMA, LookupMode.LIMITED_GLOBALS);
}
private static enum LookupMode {NO_GLOBALS, LIMITED_GLOBALS, ALL_GLOBALS}