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)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isVirtual()
*/
public boolean isVirtual() {
if( definition != null ){
IASTNode node = definition.getParent();
while( node instanceof IASTDeclarator )
node = node.getParent();
public boolean isVirtual() throws DOMException {
IASTDeclaration decl = getPrimaryDeclaration();
if( decl != null ){
ICPPASTDeclSpecifier declSpec = null;
if( node instanceof IASTSimpleDeclaration )
declSpec = (ICPPASTDeclSpecifier) ((IASTSimpleDeclaration)node).getDeclSpecifier();
else if( node instanceof IASTFunctionDefinition )
declSpec = (ICPPASTDeclSpecifier) ((IASTFunctionDefinition)node).getDeclSpecifier();
if( decl instanceof IASTSimpleDeclaration )
declSpec = (ICPPASTDeclSpecifier) ((IASTSimpleDeclaration)decl).getDeclSpecifier();
else if( decl instanceof IASTFunctionDefinition )
declSpec = (ICPPASTDeclSpecifier) ((IASTFunctionDefinition)decl).getDeclSpecifier();
if( declSpec != null ){
return declSpec.isVirtual();