Community
Participate
Working Groups
The IASTBinaryExpression created for an IASTCaseStatement which uses the GNU ellipsis operator is incorrectly set with the op_assign operator rather than op_ellipses. e.g. switch (a) { case 1 ... 3: <-- An IASTBinaryExpression is created under the IASTCaseStatement, but the operator is op_assign. break; } (Also, is there a reason why the ellipsis operator is called "op_ellipses" and not "op_ellipsis"?)
Created attachment 130225 [details] Patch so op_ellipses is used for GNU case range expression
The patch I've just added modifies AbstractGNUSourceCodeParser so the correct operator is set. I modified AST2Tests.testCaseRange_Bug211882() so that this test checks the operator. I also modified ExpressionWriter and added a test to ASTWriterStatementTestSource.awts. Previously the case statement was being rewritten as: switch (a) { case 1 = 3: break; } And, finally, I've changed ASTWriterDeclaratorTestSource.awts because the test was failing due to white space. I think my change is valid, but should probably be checked.
Thanks Richard, fixed in 6.0 > 20090401.