1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-13 03:05:39 +02:00

Bug 140973 - Fix CCE by checking instanceof first.

This commit is contained in:
Doug Schaefer 2006-05-11 14:42:33 +00:00
parent a63dcf8935
commit 006a05abdc

View file

@ -443,14 +443,15 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
public IScope getCompositeScope() { public IScope getCompositeScope() {
if( definition == null ) if( definition == null )
checkForDefinition(); checkForDefinition();
if( definition != null ) {
if( definition != null && definition instanceof ICPPASTCompositeTypeSpecifier ){ IASTNode parent = definition.getParent();
ICPPASTCompositeTypeSpecifier compSpec = (ICPPASTCompositeTypeSpecifier) definition.getParent(); if (parent instanceof ICPPASTCompositeTypeSpecifier) {
ICPPASTCompositeTypeSpecifier compSpec = (ICPPASTCompositeTypeSpecifier)parent;
return compSpec.getScope(); return compSpec.getScope();
} else {
return null;
} }
} }
return null;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see java.lang.Object#clone() * @see java.lang.Object#clone()