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:
parent
3f69713735
commit
a7da016b95
1 changed files with 8 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue