1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 16:55:38 +02:00

bug 93191 - make sure isVirtual at least returns correct result, regardless of base classes.

This commit is contained in:
Andrew Niefer 2005-07-20 14:45:36 +00:00
parent 7dc1c30cfa
commit 6cc20b8467

View file

@ -218,17 +218,14 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isVirtual() * @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isVirtual()
*/ */
public boolean isVirtual() { public boolean isVirtual() throws DOMException {
if( definition != null ){ IASTDeclaration decl = getPrimaryDeclaration();
IASTNode node = definition.getParent(); if( decl != null ){
while( node instanceof IASTDeclarator )
node = node.getParent();
ICPPASTDeclSpecifier declSpec = null; ICPPASTDeclSpecifier declSpec = null;
if( node instanceof IASTSimpleDeclaration ) if( decl instanceof IASTSimpleDeclaration )
declSpec = (ICPPASTDeclSpecifier) ((IASTSimpleDeclaration)node).getDeclSpecifier(); declSpec = (ICPPASTDeclSpecifier) ((IASTSimpleDeclaration)decl).getDeclSpecifier();
else if( node instanceof IASTFunctionDefinition ) else if( decl instanceof IASTFunctionDefinition )
declSpec = (ICPPASTDeclSpecifier) ((IASTFunctionDefinition)node).getDeclSpecifier(); declSpec = (ICPPASTDeclSpecifier) ((IASTFunctionDefinition)decl).getDeclSpecifier();
if( declSpec != null ){ if( declSpec != null ){
return declSpec.isVirtual(); return declSpec.isVirtual();