From 306de145437a1f181ef99a50536c9e6094050cce Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Fri, 11 Apr 2008 14:41:14 +0000 Subject: [PATCH] Correct parsing of typeof-expressions, bug 226492. --- .../internal/core/dom/parser/cpp/GNUCPPSourceParser.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java index f1a52df2c6e..df4c2781ba2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java @@ -417,9 +417,11 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser { final IASTExpression expr= super.conditionalExpression(); if (templateArgListCount > 0) { // bug 104706, don't allow usage of logical operators in template argument lists. - if (expr instanceof IASTConditionalExpression) - - if (expr instanceof IASTBinaryExpression) { + if (expr instanceof IASTConditionalExpression) { + final ASTNode node = (ASTNode) expr; + throwBacktrack(node.getOffset(), node.getLength()); + } + else if (expr instanceof IASTBinaryExpression) { IASTBinaryExpression bexpr= (IASTBinaryExpression) expr; switch (bexpr.getOperator()) { case IASTBinaryExpression.op_logicalAnd: