mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +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 ){
|
} else if( expression instanceof IASTFunctionCallExpression ){
|
||||||
IBinding binding = resolveBinding( expression );
|
IBinding binding = resolveBinding( expression );
|
||||||
if( binding instanceof ICPPConstructor ){
|
if( binding instanceof ICPPConstructor ){
|
||||||
ICPPClassScope scope;
|
|
||||||
try {
|
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) {
|
} catch (DOMException e) {
|
||||||
return e.getProblem();
|
return e.getProblem();
|
||||||
}
|
}
|
||||||
return scope.getClassType();
|
return new ProblemBinding(expression, IProblemBinding.SEMANTIC_BAD_SCOPE, binding.getName().toCharArray());
|
||||||
} else if( binding instanceof IFunction ){
|
} else if( binding instanceof IFunction ){
|
||||||
IFunctionType fType;
|
IFunctionType fType;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Reference in a new issue