1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2010-04-04 05:11:23 +00:00
parent b908d4b133
commit 2a47366a32

View file

@ -2761,12 +2761,12 @@ public class CPPSemantics {
} }
return null; return null;
} }
public static ICPPFunction findDestructor(ICPPASTDeleteExpression expr) { public static ICPPFunction findDestructor(ICPPASTDeleteExpression expr) {
ICPPClassType cls = getNestedClassType(expr); ICPPClassType cls = getNestedClassType(expr);
if (cls == null) if (cls == null)
return null; return null;
IScope scope = null; IScope scope = null;
try { try {
scope = cls.getCompositeScope(); scope = cls.getCompositeScope();
@ -2775,16 +2775,16 @@ public class CPPSemantics {
} }
if (scope == null) if (scope == null)
return null; return null;
CPPASTName astName = new CPPASTName(); CPPASTName astName = new CPPASTName();
astName.setParent(expr); astName.setParent(expr);
astName.setPropertyInParent(STRING_LOOKUP_PROPERTY); astName.setPropertyInParent(STRING_LOOKUP_PROPERTY);
astName.setName(CharArrayUtils.concat("~".toCharArray(), cls.getNameCharArray())); //$NON-NLS-1$ astName.setName(CharArrayUtils.concat("~".toCharArray(), cls.getNameCharArray())); //$NON-NLS-1$
LookupData data = new LookupData(astName); LookupData data = new LookupData(astName);
data.forceQualified = true; data.forceQualified = true;
data.setFunctionArguments(IASTExpression.EMPTY_EXPRESSION_ARRAY); data.setFunctionArguments(IASTExpression.EMPTY_EXPRESSION_ARRAY);
try { try {
lookup(data, scope); lookup(data, scope);
IBinding binding = resolveAmbiguities(data, astName); IBinding binding = resolveAmbiguities(data, astName);
@ -2794,27 +2794,27 @@ public class CPPSemantics {
} }
return null; return null;
} }
public static ICPPFunction findOverloadedOperator(IASTUnaryExpression exp) { public static ICPPFunction findOverloadedOperator(IASTUnaryExpression exp) {
if (exp.getOperand() == null) if (exp.getOperand() == null)
return null; return null;
OverloadableOperator op = OverloadableOperator.fromUnaryExpression(exp); OverloadableOperator op = OverloadableOperator.fromUnaryExpression(exp);
if (op == null) if (op == null)
return null; return null;
IASTExpression[] args; IASTExpression[] args;
int operator = exp.getOperator(); int operator = exp.getOperator();
if (operator == IASTUnaryExpression.op_postFixDecr || operator == IASTUnaryExpression.op_postFixIncr) if (operator == IASTUnaryExpression.op_postFixDecr || operator == IASTUnaryExpression.op_postFixIncr)
args = new IASTExpression[] { exp.getOperand(), CPPASTLiteralExpression.INT_ZERO }; args = new IASTExpression[] { exp.getOperand(), CPPASTLiteralExpression.INT_ZERO };
else else
args = new IASTExpression[] { exp.getOperand() }; args = new IASTExpression[] { exp.getOperand() };
IType type = exp.getOperand().getExpressionType(); IType type = exp.getOperand().getExpressionType();
type = SemanticUtil.getNestedType(type, TDEF | REF | CVTYPE); type = SemanticUtil.getNestedType(type, TDEF | REF | CVTYPE);
if (!isUserDefined(type)) if (!isUserDefined(type))
return null; return null;
return findOverloadedOperator(exp, args, type, op.toCharArray(), NonMemberMode.limited); return findOverloadedOperator(exp, args, type, op.toCharArray(), NonMemberMode.limited);
} }