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:
parent
4d48a99d44
commit
eb5caf452e
1 changed files with 15 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue