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 282f93ed143..96f7506744c 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 @@ -1869,6 +1869,14 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser { IASTExpression condition = null; try { condition = condition(); + if (LT(1) == IToken.tEOC) { + // Completing in the condition + result = createIfStatement(); + result.setCondition(condition); + condition.setParent(result); + condition.setPropertyInParent(IASTIfStatement.CONDITION); + return result; + } consume(IToken.tRPAREN); } catch (BacktrackException b) { IASTProblem p = failParse(b);