1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 14:12:10 +02:00

Follow up for bug 292051.

This commit is contained in:
Markus Schorn 2009-10-14 12:10:40 +00:00
parent 6ddc2fc4ca
commit 06bfab7f23

View file

@ -42,14 +42,14 @@ public class CPPMethodTemplate extends CPPFunctionTemplate implements ICPPMethod
public IASTDeclaration getPrimaryDeclaration() throws DOMException{
//first check if we already know it
if( declarations != null ){
if (declarations != null) {
for (IASTName declaration : declarations) {
IASTNode parent = declaration.getParent();
while (!(parent instanceof IASTDeclaration) && parent != null)
parent = parent.getParent();
IASTDeclaration decl = (IASTDeclaration) parent;
if (decl instanceof ICPPASTCompositeTypeSpecifier)
if (decl != null && decl.getParent() instanceof ICPPASTCompositeTypeSpecifier)
return decl;
}
}