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 8760d3dcfae..cbcd3b12ba7 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 @@ -5879,4 +5879,19 @@ public class AST2Tests extends AST2BaseTest { parseAndCheckBindings(code, ParserLanguage.C, true); parseAndCheckBindings(code, ParserLanguage.CPP, true); } + + // void test() { + // int a,b; + // if ((a)+b); + // } + public void testAmbiguityResolutionInIfCondition_Bug261043() throws Exception { + final String code= getAboveComment(); + for (ParserLanguage lang : ParserLanguage.values()) { + IASTTranslationUnit tu= parseAndCheckBindings(code, lang, true); + IASTFunctionDefinition fdef= getDeclaration(tu, 0); + IASTIfStatement ifstmt= getStatement(fdef, 1); + IASTExpression expr= ifstmt.getConditionExpression(); + assertInstance(expr, IASTBinaryExpression.class); + } + } }