mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix and Testcase for 185120, handling of constants with suffix 'ul'.
This commit is contained in:
parent
d6ce933a26
commit
13c3948164
2 changed files with 19 additions and 1 deletions
|
@ -2665,4 +2665,16 @@ public class Scanner2Test extends BaseScanner2Test
|
|||
validateToken( IToken.tRPAREN );
|
||||
validateChar( "s" );
|
||||
}
|
||||
|
||||
public void testBug185120() throws Exception {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append("#define TEST_DEFINE 1UL\n");
|
||||
buffer.append("#if TEST_DEFINE != 1UL\n");
|
||||
buffer.append("-\n");
|
||||
buffer.append("#else\n");
|
||||
buffer.append("+\n");
|
||||
buffer.append("#endif\n");
|
||||
initializeScanner( buffer.toString() );
|
||||
validateToken( IToken.tPLUS );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -618,8 +618,14 @@ public class ExpressionEvaluator {
|
|||
// end of number
|
||||
if (c == 'L' || c == 'l' || c == 'U' || c == 'u') {
|
||||
// eat the long/unsigned
|
||||
int pos= ++bufferPos[bufferStackPos];
|
||||
if (pos < limit) {
|
||||
c= buffer[pos];
|
||||
if (c == 'L' || c == 'l' || c == 'U' || c == 'u') {
|
||||
++bufferPos[bufferStackPos];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// done
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue