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:
parent
7dc1c30cfa
commit
6cc20b8467
1 changed files with 7 additions and 10 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue