mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-03 14:25:37 +02:00
Tightened up the handling of EOC in sizeof and fixed a failed test.
This commit is contained in:
parent
bbb453cd43
commit
5dee577e8a
1 changed files with 9 additions and 3 deletions
|
@ -1305,10 +1305,16 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
try {
|
||||
consume(IToken.tLPAREN);
|
||||
typeId = typeId(true, false);
|
||||
if (LT(1) == IToken.tRPAREN)
|
||||
switch (LT(1)) {
|
||||
case IToken.tRPAREN:
|
||||
lastOffset = consume(IToken.tRPAREN).getEndOffset();
|
||||
else
|
||||
lastOffset = Integer.MAX_VALUE; // tEOC
|
||||
break;
|
||||
case IToken.tEOC:
|
||||
lastOffset = Integer.MAX_VALUE;
|
||||
break;
|
||||
default:
|
||||
throw backtrack;
|
||||
}
|
||||
} catch (BacktrackException bt) {
|
||||
backup(mark);
|
||||
unaryExpression = unaryExpression();
|
||||
|
|
Loading…
Add table
Reference in a new issue