1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

fix bug 92773, ClassCastException

This commit is contained in:
Andrew Niefer 2005-04-26 22:07:58 +00:00
parent 10298b85c7
commit 3fedd1b299

View file

@ -247,13 +247,22 @@ public class CPPClassType implements ICPPClassType, ICPPInternalClassType {
private ICPPASTCompositeTypeSpecifier getCompositeTypeSpecifier(){
if( definition != null ){
return (ICPPASTCompositeTypeSpecifier) definition.getParent();
IASTNode node = definition;
while( node instanceof IASTName )
node = node.getParent();
if( node instanceof ICPPASTCompositeTypeSpecifier )
return (ICPPASTCompositeTypeSpecifier)node;
}
return null;
}
private ICPPASTElaboratedTypeSpecifier getElaboratedTypeSpecifier() {
if( declarations != null )
return (ICPPASTElaboratedTypeSpecifier) declarations[0].getParent();
if( declarations != null ){
IASTNode node = declarations[0];
while( node instanceof IASTName )
node = node.getParent();
if( node instanceof ICPPASTElaboratedTypeSpecifier )
return (ICPPASTElaboratedTypeSpecifier)node;
}
return null;
}
/* (non-Javadoc)