Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-04-10 16:14:43 +0000
committerMarkus Schorn2008-04-10 16:14:43 +0000
commitb74edd50a199190d44897d46ccaf21eca6a1920d (patch)
tree5af73bc5a01f151c4d97a76a2396e5905045a7de /core/org.eclipse.cdt.core
parent1e97408e2ba2f90f5be189b54ba4202fb75298c0 (diff)
downloadorg.eclipse.cdt-b74edd50a199190d44897d46ccaf21eca6a1920d.tar.gz
org.eclipse.cdt-b74edd50a199190d44897d46ccaf21eca6a1920d.tar.xz
org.eclipse.cdt-b74edd50a199190d44897d46ccaf21eca6a1920d.zip
Correct parsing of typeof-expressions, bug 226492.
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java
index 3b6669f02a..84e7aca8f7 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java
@@ -850,15 +850,15 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
BacktrackException {
int offset = consume().getOffset(); // t_typeof
IASTTypeId d = null;
- IASTExpression unaryExpression = null;
+ IASTExpression expression = null;
int lastOffset = 0;
- // prefer unary expressions over type-expressions
+ // prefer expressions over type-ids
if (LT(1) == IToken.tLPAREN && LT(2) != IToken.tLBRACE) {
consume();
final IToken m = mark();
try {
- unaryExpression= unaryExpression();
+ expression= expression();
}
catch (BacktrackException e) {
backup(m);
@@ -868,14 +868,14 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
}
lastOffset = consume(IToken.tRPAREN).getEndOffset();
} else {
- unaryExpression = unaryExpression();
- lastOffset = calculateEndOffset(unaryExpression);
+ expression = unaryExpression();
+ lastOffset = calculateEndOffset(expression);
}
if (d != null)
return buildTypeIdExpression(IGNUASTTypeIdExpression.op_typeof, d, offset, lastOffset);
- if (unaryExpression != null)
- return buildUnaryExpression(IGNUASTUnaryExpression.op_typeof, unaryExpression, offset, lastOffset);
+ if (expression != null)
+ return buildUnaryExpression(IGNUASTUnaryExpression.op_typeof, expression, offset, lastOffset);
return null;
}

Back to the top