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:
parent
10298b85c7
commit
3fedd1b299
1 changed files with 12 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue