1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

fix bug 102149 : [CCE] caused by simple C++ code

This commit is contained in:
Andrew Niefer 2005-07-05 15:46:52 +00:00
parent 23bf7780e8
commit 1dfd3e2006

View file

@ -193,8 +193,19 @@ public class CPPVariable implements ICPPVariable, ICPPInternalBinding {
*/ */
public IType getType() { public IType getType() {
if( type == null ){ if( type == null ){
IASTDeclarator dtor = (IASTDeclarator) ( (definition != null) ? definition.getParent() : declarations[0].getParent() ); IASTName n = null;
type = CPPVisitor.createType( dtor ); if( definition != null )
n = definition;
else if( declarations != null && declarations.length > 0 )
n = declarations[0];
if( n != null ){
while( n.getParent() instanceof IASTName )
n = (IASTName) n.getParent();
IASTNode node = n.getParent();
if( node instanceof IASTDeclarator )
type = CPPVisitor.createType( (IASTDeclarator)node );
}
} }
return type; return type;
} }