mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 192239, NPE in CPPClassTemplate.
This commit is contained in:
parent
9a64852657
commit
3ac39f0507
1 changed files with 10 additions and 2 deletions
|
@ -437,8 +437,16 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
|
|||
* @see org.eclipse.cdt.core.dom.ast.ICompositeType#getKey()
|
||||
*/
|
||||
public int getKey() {
|
||||
if( definition != null )
|
||||
return getCompositeTypeSpecifier().getKey();
|
||||
if( definition != null ) {
|
||||
ICPPASTCompositeTypeSpecifier cts= getCompositeTypeSpecifier();
|
||||
if (cts != null) {
|
||||
return cts.getKey();
|
||||
}
|
||||
IASTNode n= definition.getParent();
|
||||
if (n instanceof ICPPASTElaboratedTypeSpecifier) {
|
||||
return ((ICPPASTElaboratedTypeSpecifier)n).getKind();
|
||||
}
|
||||
}
|
||||
|
||||
if( declarations != null && declarations.length > 0 ){
|
||||
IASTNode n = declarations[0].getParent();
|
||||
|
|
Loading…
Add table
Reference in a new issue