1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

Testcase for bug 261043.

This commit is contained in:
Markus Schorn 2009-01-16 15:21:11 +00:00
parent 4d48a99d44
commit eb5caf452e

View file

@ -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);
}
}
}