1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 20:05:35 +02:00

Fix for ClassCastException (bug 233284).

This commit is contained in:
Sergey Prigogin 2008-05-21 21:22:16 +00:00
parent 5297afa058
commit 63089ab4e0

View file

@ -1997,13 +1997,16 @@ public class CPPVisitor {
ICPPFunctionType functionType = (ICPPFunctionType) type; ICPPFunctionType functionType = (ICPPFunctionType) type;
IPointerType thisType = functionType.getThisType(); IPointerType thisType = functionType.getThisType();
if (thisType != null) { if (thisType != null) {
ICPPClassType classType; IType nestedType;
try { try {
classType = (ICPPClassType) thisType.getType(); nestedType = thisType.getType();
while (nestedType instanceof ITypeContainer) {
nestedType = ((ITypeContainer) nestedType).getType();
}
} catch (DOMException e) { } catch (DOMException e) {
return e.getProblem(); return e.getProblem();
} }
return new CPPPointerToMemberType(type, classType, return new CPPPointerToMemberType(type, (ICPPClassType) nestedType,
thisType.isConst(), thisType.isVolatile()); thisType.isConst(), thisType.isVolatile());
} }
} }