mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Cosmetics.
This commit is contained in:
parent
03f572e385
commit
467bbc0b52
1 changed files with 15 additions and 17 deletions
|
@ -114,15 +114,15 @@ public class AbstractClassInstantiationChecker extends AbstractIndexAstChecker {
|
|||
IASTName className = ((ICPPASTNamedTypeSpecifier) declSpec).getName();
|
||||
IBinding binding = className.resolveBinding();
|
||||
if (binding instanceof IType) {
|
||||
// Resolve class and check whether it is abstract
|
||||
// Resolve class and check whether it is abstract.
|
||||
reportProblemsIfAbstract((IType) binding, className);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int visit(IASTExpression expression) {
|
||||
// Looking for the new expression
|
||||
if (expression instanceof ICPPASTNewExpression) {
|
||||
// New expression.
|
||||
ICPPASTNewExpression newExpression = (ICPPASTNewExpression) expression;
|
||||
if (!hasPointerOrReference(newExpression.getTypeId().getAbstractDeclarator())) {
|
||||
// Try to resolve its implicit constructor
|
||||
|
@ -132,9 +132,8 @@ public class AbstractClassInstantiationChecker extends AbstractIndexAstChecker {
|
|||
checkClassConstructor(constructorName);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Looking for direct class constructor call and check it.
|
||||
else if (expression instanceof ICPPASTFunctionCallExpression) {
|
||||
} else if (expression instanceof ICPPASTFunctionCallExpression) {
|
||||
// Direct constructor call.
|
||||
ICPPASTFunctionCallExpression functionCall = (ICPPASTFunctionCallExpression) expression;
|
||||
IASTExpression functionName = functionCall.getFunctionNameExpression();
|
||||
if (functionName instanceof IASTIdExpression) {
|
||||
|
@ -154,8 +153,7 @@ public class AbstractClassInstantiationChecker extends AbstractIndexAstChecker {
|
|||
if (binding instanceof ICPPConstructor) {
|
||||
// Resolve class and check whether it is abstract.
|
||||
reportProblemsIfAbstract(((ICPPConstructor) binding).getClassOwner(), constructorName);
|
||||
}
|
||||
else if (binding instanceof IType) {
|
||||
} else if (binding instanceof IType) {
|
||||
reportProblemsIfAbstract((IType) binding, constructorName);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue