mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Bug 140973 - Fix CCE by checking instanceof first.
This commit is contained in:
parent
a63dcf8935
commit
006a05abdc
1 changed files with 7 additions and 6 deletions
|
@ -443,13 +443,14 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
|
|||
public IScope getCompositeScope() {
|
||||
if( definition == null )
|
||||
checkForDefinition();
|
||||
|
||||
if( definition != null && definition instanceof ICPPASTCompositeTypeSpecifier ){
|
||||
ICPPASTCompositeTypeSpecifier compSpec = (ICPPASTCompositeTypeSpecifier) definition.getParent();
|
||||
return compSpec.getScope();
|
||||
} else {
|
||||
return null;
|
||||
if( definition != null ) {
|
||||
IASTNode parent = definition.getParent();
|
||||
if (parent instanceof ICPPASTCompositeTypeSpecifier) {
|
||||
ICPPASTCompositeTypeSpecifier compSpec = (ICPPASTCompositeTypeSpecifier)parent;
|
||||
return compSpec.getScope();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
Loading…
Add table
Reference in a new issue