diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java index 443e4bae6b1..2c3fa8348d4 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java @@ -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(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java index 38e8cf357d9..2068d65eee9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java @@ -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}