mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Fixed EvalConstructor.isConstantExpression method
Change-Id: I17e3d9bb53cd8667832c9414108247ccde75e0b7
This commit is contained in:
parent
4c4fb739b1
commit
87ada6a98b
1 changed files with 11 additions and 1 deletions
|
@ -54,6 +54,8 @@ public final class EvalConstructor extends CPPDependentEvaluation {
|
||||||
private final ICPPEvaluation[] fArguments;
|
private final ICPPEvaluation[] fArguments;
|
||||||
private boolean fCheckedIsTypeDependent;
|
private boolean fCheckedIsTypeDependent;
|
||||||
private boolean fIsTypeDependent;
|
private boolean fIsTypeDependent;
|
||||||
|
private boolean fCheckedIsConstantExpression;
|
||||||
|
private boolean fIsConstantExpression;
|
||||||
private static final IASTName TEMP_NAME = ASTNodeFactoryFactory.getDefaultCPPNodeFactory().newName();
|
private static final IASTName TEMP_NAME = ASTNodeFactoryFactory.getDefaultCPPNodeFactory().newName();
|
||||||
|
|
||||||
public EvalConstructor(IType type, ICPPConstructor constructor, ICPPEvaluation[] arguments, IBinding templateDefinition) {
|
public EvalConstructor(IType type, ICPPConstructor constructor, ICPPEvaluation[] arguments, IBinding templateDefinition) {
|
||||||
|
@ -99,7 +101,15 @@ public final class EvalConstructor extends CPPDependentEvaluation {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isConstantExpression(IASTNode point) {
|
public boolean isConstantExpression(IASTNode point) {
|
||||||
return true;
|
if (!fCheckedIsConstantExpression) {
|
||||||
|
fCheckedIsConstantExpression = true;
|
||||||
|
fIsConstantExpression = computeIsConstantExpression(point);
|
||||||
|
}
|
||||||
|
return fIsConstantExpression;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean computeIsConstantExpression(IASTNode point) {
|
||||||
|
return fConstructor.isConstexpr() && areAllConstantExpressions(fArguments, point);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue