summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java33
1 files changed, 30 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java
index 3ebf67a..39ecade 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* Andrew Niefer (IBM Corporation) - initial API and implementation
* Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -225,6 +226,32 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
*/
@Override
public boolean isPureVirtual() {
+ ICPPASTFunctionDeclarator declarator = findFunctionDeclarator();
+ if(declarator != null){
+ return declarator.isPureVirtual();
+ }
+ return false;
+ }
+
+ @Override
+ public boolean isFinal() {
+ ICPPASTFunctionDeclarator declarator = findFunctionDeclarator();
+ if(declarator != null){
+ return declarator.isFinal();
+ }
+ return false;
+ }
+
+ @Override
+ public boolean isOverride() {
+ ICPPASTFunctionDeclarator declarator = findFunctionDeclarator();
+ if(declarator != null){
+ return declarator.isOverride();
+ }
+ return false;
+ }
+
+ private ICPPASTFunctionDeclarator findFunctionDeclarator(){
if (declarations != null) {
for (IASTDeclarator dtor : declarations) {
if (dtor == null)
@@ -235,12 +262,12 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
if (decl.getParent() instanceof ICPPASTCompositeTypeSpecifier) {
dtor= ASTQueries.findTypeRelevantDeclarator(dtor);
if (dtor instanceof ICPPASTFunctionDeclarator) {
- return ((ICPPASTFunctionDeclarator) dtor).isPureVirtual();
+ return (ICPPASTFunctionDeclarator) dtor;
}
}
}
}
- return false;
+ return definition;
}
@Override