diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java index b4e44c4c3fb..b0c4ba1586d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java @@ -174,12 +174,12 @@ public class Value implements IValue { if (e instanceof IASTBinaryExpression) { return evaluateBinaryExpression((IASTBinaryExpression) e, maxdepth); } + if (e instanceof IASTCastExpression) { // must be ahead of unary + return evaluate(((IASTCastExpression) e).getOperand(), maxdepth); + } if (e instanceof IASTUnaryExpression) { return evaluateUnaryExpression((IASTUnaryExpression) e, maxdepth); } - if (e instanceof IASTCastExpression) { - return evaluate(((IASTCastExpression) e).getOperand(), maxdepth); - } if (e instanceof IASTConditionalExpression) { IASTConditionalExpression cexpr= (IASTConditionalExpression) e; Object o= evaluate(cexpr.getLogicalConditionExpression(), maxdepth); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/VariableReadWriteFlags.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/VariableReadWriteFlags.java index d45d0083fe7..aee435f6b77 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/VariableReadWriteFlags.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/VariableReadWriteFlags.java @@ -92,6 +92,9 @@ public abstract class VariableReadWriteFlags { if (expr instanceof IASTBinaryExpression) { return rwInBinaryExpression(node, (IASTBinaryExpression) expr, indirection); } + if (expr instanceof IASTCastExpression) { // must be ahead of unary + return rwAnyNode(expr, indirection); + } if (expr instanceof IASTUnaryExpression) { return rwInUnaryExpression(node, (IASTUnaryExpression) expr, indirection); } @@ -101,9 +104,6 @@ public abstract class VariableReadWriteFlags { } return READ; } - if (expr instanceof IASTCastExpression) { - return rwAnyNode(expr, indirection); - } if (expr instanceof IASTConditionalExpression) { if (node.getPropertyInParent() == IASTConditionalExpression.LOGICAL_CONDITION) { return READ;