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:
parent
6ddc2fc4ca
commit
06bfab7f23
1 changed files with 2 additions and 2 deletions
|
@ -42,14 +42,14 @@ public class CPPMethodTemplate extends CPPFunctionTemplate implements ICPPMethod
|
||||||
|
|
||||||
public IASTDeclaration getPrimaryDeclaration() throws DOMException{
|
public IASTDeclaration getPrimaryDeclaration() throws DOMException{
|
||||||
//first check if we already know it
|
//first check if we already know it
|
||||||
if( declarations != null ){
|
if (declarations != null) {
|
||||||
for (IASTName declaration : declarations) {
|
for (IASTName declaration : declarations) {
|
||||||
IASTNode parent = declaration.getParent();
|
IASTNode parent = declaration.getParent();
|
||||||
while (!(parent instanceof IASTDeclaration) && parent != null)
|
while (!(parent instanceof IASTDeclaration) && parent != null)
|
||||||
parent = parent.getParent();
|
parent = parent.getParent();
|
||||||
|
|
||||||
IASTDeclaration decl = (IASTDeclaration) parent;
|
IASTDeclaration decl = (IASTDeclaration) parent;
|
||||||
if (decl instanceof ICPPASTCompositeTypeSpecifier)
|
if (decl != null && decl.getParent() instanceof ICPPASTCompositeTypeSpecifier)
|
||||||
return decl;
|
return decl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue