1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Fix for 191198, ClassCastException in binding resolution.

This commit is contained in:
Markus Schorn 2007-06-06 10:59:37 +00:00
parent 3f69713735
commit a7da016b95

View file

@ -1750,13 +1750,18 @@ public class CPPVisitor {
} else if( expression instanceof IASTFunctionCallExpression ){
IBinding binding = resolveBinding( expression );
if( binding instanceof ICPPConstructor ){
ICPPClassScope scope;
try {
scope = (ICPPClassScope) ((ICPPConstructor)binding).getScope();
IScope scope= binding.getScope();
if (scope instanceof ICPPTemplateScope && ! (scope instanceof ICPPClassScope)) {
scope= scope.getParent();
}
if (scope instanceof ICPPClassScope) {
return ((ICPPClassScope) scope).getClassType();
}
} catch (DOMException e) {
return e.getProblem();
}
return scope.getClassType();
return new ProblemBinding(expression, IProblemBinding.SEMANTIC_BAD_SCOPE, binding.getName().toCharArray());
} else if( binding instanceof IFunction ){
IFunctionType fType;
try {