diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTCompoundStatementExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTCompoundStatementExpression.java index 97c4ac5457d..e39a5d739d0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTCompoundStatementExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTCompoundStatementExpression.java @@ -35,26 +35,6 @@ public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUAS private ICPPEvaluation fEval; private IASTImplicitDestructorName[] fImplicitDestructorNames; - public CPPASTCompoundStatementExpression() { - } - - @Override - public ICPPEvaluation getEvaluation() { - if (fEval == null) { - IASTCompoundStatement compound = getCompoundStatement(); - IASTStatement[] statements = compound.getStatements(); - if (statements.length > 0) { - IASTStatement st = statements[statements.length - 1]; - if (st instanceof IASTExpressionStatement) { - fEval= new EvalCompound(((ICPPASTExpression) ((IASTExpressionStatement) st).getExpression()).getEvaluation(), this); - } - } - if (fEval == null) - fEval= EvalFixed.INCOMPLETE; - } - return fEval; - } - public CPPASTCompoundStatementExpression(IASTCompoundStatement statement) { setCompoundStatement(statement); } @@ -66,8 +46,8 @@ public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUAS @Override public CPPASTCompoundStatementExpression copy(CopyStyle style) { - CPPASTCompoundStatementExpression copy = new CPPASTCompoundStatementExpression(); - copy.setCompoundStatement(fStatement == null ? null : fStatement.copy(style)); + CPPASTCompoundStatementExpression copy = + new CPPASTCompoundStatementExpression(fStatement == null ? null : fStatement.copy(style)); return copy(copy, style); } @@ -86,6 +66,24 @@ public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUAS } } + @Override + public ICPPEvaluation getEvaluation() { + if (fEval == null) { + if (fStatement != null) { + IASTStatement[] statements = fStatement.getStatements(); + if (statements.length > 0) { + IASTStatement st = statements[statements.length - 1]; + if (st instanceof IASTExpressionStatement) { + fEval= new EvalCompound(((ICPPASTExpression) ((IASTExpressionStatement) st).getExpression()).getEvaluation(), this); + } + } + } + if (fEval == null) + fEval= EvalFixed.INCOMPLETE; + } + return fEval; + } + @Override public IASTImplicitDestructorName[] getImplicitDestructorNames() { if (fImplicitDestructorNames == null) {