mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Fix for 193112, ClassCastException in binding resolution.
This commit is contained in:
parent
f7b4561c05
commit
aca7156c0c
1 changed files with 9 additions and 1 deletions
|
@ -26,6 +26,7 @@ import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
|||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IFunctionType;
|
||||
import org.eclipse.cdt.core.dom.ast.IParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclSpecifier;
|
||||
|
@ -180,7 +181,14 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition implements ICPPFu
|
|||
if( size > 0 ){
|
||||
for( int i = 0; i < size; i++ ){
|
||||
IASTParameterDeclaration p = params[i];
|
||||
result[i] = (IParameter) p.getDeclarator().getName().resolveBinding();
|
||||
final IASTName pname = p.getDeclarator().getName();
|
||||
final IBinding binding= pname.resolveBinding();
|
||||
if (binding instanceof IParameter) {
|
||||
result[i]= (IParameter) binding;
|
||||
}
|
||||
else {
|
||||
result[i] = new CPPParameter.CPPParameterProblem(p, IProblemBinding.SEMANTIC_INVALID_TYPE, pname.toCharArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Add table
Reference in a new issue