diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPEvaluation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPEvaluation.java index 2844827e1b5..66c515c343b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPEvaluation.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPEvaluation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2013 Google, Inc and others. + * Copyright (c) 2012, 2014 Google, Inc and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,10 +30,10 @@ public abstract class CPPEvaluation implements ICPPEvaluation { } @Override - public IBinding getTemplateDefinition() { + public IBinding getTemplateDefinition() { return null; } - + @Override public char[] getSignature() { SignatureBuilder buf = new SignatureBuilder(); @@ -91,7 +91,7 @@ public abstract class CPPEvaluation implements ICPPEvaluation { } return false; } - + protected static boolean areAllConstantExpressions(ICPPEvaluation[] evaluations, IASTNode point) { for (ICPPEvaluation eval : evaluations) { if (!eval.isConstantExpression(point)) { @@ -100,7 +100,7 @@ public abstract class CPPEvaluation implements ICPPEvaluation { } return true; } - + protected static boolean isConstexprValue(IValue value, IASTNode point) { if (value == null) { return false; @@ -111,8 +111,8 @@ public abstract class CPPEvaluation implements ICPPEvaluation { } return innerEval.isConstantExpression(point); } - - protected static boolean isConstexprFuncOrNull(ICPPFunction function) { + + protected static boolean isNullOrConstexprFunc(ICPPFunction function) { return function == null || function.isConstexpr(); } } \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalBinary.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalBinary.java index 88a2ce96c6a..8e921e46de2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalBinary.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalBinary.java @@ -191,7 +191,7 @@ public class EvalBinary extends CPPDependentEvaluation { public boolean isConstantExpression(IASTNode point) { return fArg1.isConstantExpression(point) && fArg2.isConstantExpression(point) - && isConstexprFuncOrNull(getOverload(point)); + && isNullOrConstexprFunc(getOverload(point)); } @Override diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalComma.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalComma.java index 08d498d3548..d1d22bfb49e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalComma.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalComma.java @@ -79,7 +79,7 @@ public class EvalComma extends CPPDependentEvaluation { return false; } for (ICPPFunction overload : fOverloads) { - if (!isConstexprFuncOrNull(overload)) { + if (!isNullOrConstexprFunc(overload)) { return false; } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalFunctionCall.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalFunctionCall.java index 599ec353aa8..f10eb1fe915 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalFunctionCall.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalFunctionCall.java @@ -87,7 +87,7 @@ public class EvalFunctionCall extends CPPDependentEvaluation { @Override public boolean isConstantExpression(IASTNode point) { return areAllConstantExpressions(fArguments, point) - && isConstexprFuncOrNull(getOverload(point)); + && isNullOrConstexprFunc(getOverload(point)); } public ICPPFunction getOverload(IASTNode point) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalTypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalTypeId.java index 788015d66f5..5f2abecc943 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalTypeId.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalTypeId.java @@ -44,7 +44,7 @@ public class EvalTypeId extends CPPDependentEvaluation { private final ICPPEvaluation[] fArguments; private final boolean fRepresentsNewExpression; private IType fOutputType; - + private ICPPFunction fConstructor = CPPFunction.UNINITIALIZED_FUNCTION; private boolean fCheckedIsTypeDependent; private boolean fIsTypeDependent; @@ -56,7 +56,7 @@ public class EvalTypeId extends CPPDependentEvaluation { public EvalTypeId(IType type, IBinding templateDefinition, ICPPEvaluation... arguments) { this(type, templateDefinition, false, arguments); } - + private EvalTypeId(IType type, IBinding templateDefinition, boolean forNewExpression, ICPPEvaluation... arguments) { super(templateDefinition); if (arguments == null) @@ -146,25 +146,25 @@ public class EvalTypeId extends CPPDependentEvaluation { public boolean isConstantExpression(IASTNode point) { return !fRepresentsNewExpression && areAllConstantExpressions(fArguments, point) - && isConstexprFuncOrNull(getConstructor(point)); + && isNullOrConstexprFunc(getConstructor(point)); } @Override public ValueCategory getValueCategory(IASTNode point) { return valueCategoryFromReturnType(fInputType); } - + public ICPPFunction getConstructor(IASTNode point) { if (fConstructor == CPPFunction.UNINITIALIZED_FUNCTION) { fConstructor = computeConstructor(point); } return fConstructor; } - + private ICPPFunction computeConstructor(IASTNode point) { if (isTypeDependent()) return null; - + IType simplifiedType = SemanticUtil.getNestedType(fInputType, SemanticUtil.TDEF); if (simplifiedType instanceof ICPPClassType) { ICPPClassType classType = (ICPPClassType) simplifiedType; @@ -220,9 +220,9 @@ public class EvalTypeId extends CPPDependentEvaluation { IType type = CPPTemplates.instantiateType(fInputType, tpMap, packOffset, within, point); if (args == fArguments && type == fInputType) return this; - + EvalTypeId result = new EvalTypeId(type, getTemplateDefinition(), fRepresentsNewExpression, args); - + if (!result.isTypeDependent()) { IType simplifiedType = SemanticUtil.getNestedType(type, SemanticUtil.TDEF); if (simplifiedType instanceof ICPPClassType) { @@ -234,13 +234,13 @@ public class EvalTypeId extends CPPDependentEvaluation { } } } - + return result; } @Override - public ICPPEvaluation computeForFunctionCall(CPPFunctionParameterMap parameterMap, - int maxdepth, IASTNode point) { + public ICPPEvaluation computeForFunctionCall(CPPFunctionParameterMap parameterMap, int maxdepth, + IASTNode point) { ICPPEvaluation[] args = fArguments; for (int i = 0; i < fArguments.length; i++) { ICPPEvaluation arg = fArguments[i].computeForFunctionCall(parameterMap, maxdepth, point); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnary.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnary.java index 4a190e88f24..e627f887b09 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnary.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnary.java @@ -148,7 +148,7 @@ public class EvalUnary extends CPPDependentEvaluation { @Override public boolean isConstantExpression(IASTNode point) { return fArgument.isConstantExpression(point) - && isConstexprFuncOrNull(getOverload(point)); + && isNullOrConstexprFunc(getOverload(point)); } public ICPPFunction getOverload(IASTNode point) {