From ea7f5375cdf42a5002cb782547a0214d4fc4af2d Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Wed, 13 Feb 2008 14:39:58 +0000 Subject: [PATCH] Testcase for cast ambiguities, bug 100641 and 106279. --- .../cdt/core/parser/tests/ast2/AST2Tests.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java index f1c9321bf7f..0637eeae3a6 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java @@ -4195,4 +4195,24 @@ public class AST2Tests extends AST2BaseTest { } } } + + // void isTrue( int field, int bit ){ + // return ((field) & (bit)); + // } + // void test() { + // int foux=0, bhar=0; + // foux = (foux) - bhar1; + // } + public void testBug100641_106279_castAmbiguity() throws Exception { + StringBuffer[] buffer = getContents(1); + final String content1 = buffer[0].toString(); + boolean cpp= false; + do { + BindingAssertionHelper ba= new BindingAssertionHelper(content1, cpp); + ba.assertNonProblem("field)", 5); + ba.assertNonProblem("bit))", 3); + ba.assertNonProblem("foux)", 4); + cpp= !cpp; + } while(cpp); + } } \ No newline at end of file