mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 02:05:39 +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() {
|
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) {
|
||||||
return compSpec.getScope();
|
ICPPASTCompositeTypeSpecifier compSpec = (ICPPASTCompositeTypeSpecifier)parent;
|
||||||
} else {
|
return compSpec.getScope();
|
||||||
return null;
|
}
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
Loading…
Add table
Reference in a new issue