summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Corbat2012-08-29 00:36:11 (EDT)
committer Sergey Prigogin2012-08-29 00:36:11 (EDT)
commit6d4c1e4dffcdc14c1b9db7420f6682f779022705 (patch)
tree0f4b6c49c3d7f5510f6ed93f251421a3fc21db16
parentcce375dd68e7ae9288d141d018fe529ed740cb2a (diff)
downloadorg.eclipse.cdt-6d4c1e4dffcdc14c1b9db7420f6682f779022705.zip
org.eclipse.cdt-6d4c1e4dffcdc14c1b9db7420f6682f779022705.tar.gz
org.eclipse.cdt-6d4c1e4dffcdc14c1b9db7420f6682f779022705.tar.bz2
Bug 380623 - [C++11] Explicit Virtual Overrides
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java160
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ClassTests.java17
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java28
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/pdomtests/classTests/class.cpp3
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/pdomtests/methodTests/inheritance.cpp12
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterDeclSpecTestSource.awts8
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterDeclaratorTestSource.awts29
-rw-r--r--core/org.eclipse.cdt.core/.settings/.api_filters12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCompositeTypeSpecifier.java15
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTFunctionDeclarator.java43
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMethod.java15
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Keywords.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTCompositeTypeSpecifier.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java27
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java20
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java20
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitMethod.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java33
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodInstance.java17
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodSpecialization.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplate.java61
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplateSpecialization.java16
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownConstructor.java15
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java84
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclSpecWriter.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java29
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodInstance.java29
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodSpecialization.java32
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplate.java29
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplateSpecialization.java37
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTemplateTemplateParameter.java31
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUnknownClassType.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMASTAdapter.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPAnnotation.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java28
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java22
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPDeferredClassInstance.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java21
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodInstance.java31
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodSpecialization.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplate.java17
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplateSpecialization.java17
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTemplateTemplateParameter.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassType.java8
51 files changed, 969 insertions, 169 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
index 7465d5d..506f6a1 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
@@ -56,6 +56,7 @@ import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNameOwner;
import org.eclipse.cdt.core.dom.ast.IASTNamedTypeSpecifier;
+import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTProblemDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTReturnStatement;
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
@@ -128,6 +129,8 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNameBase;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPMethod;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding;
import org.eclipse.cdt.internal.core.dom.parser.cpp.OverloadableOperator;
@@ -9768,4 +9771,161 @@ public class AST2CPPTests extends AST2BaseTest {
public void testFriendTemplateParameter() throws Exception {
parseAndCheckBindings();
}
+
+ // struct S {
+ // virtual void mFuncDecl() final;
+ // virtual void mFuncDef() final {}
+ // };
+ public void testFinalFunction() throws Exception {
+ String code = getAboveComment();
+ parseAndCheckBindings(code);
+
+ BindingAssertionHelper bindingHelper = new BindingAssertionHelper(code, true);
+
+ CPPMethod functionDeclarationBinding = bindingHelper.assertNonProblem("mFuncDecl()", 9);
+ assertFalse(functionDeclarationBinding.isOverride());
+ assertTrue(functionDeclarationBinding.isFinal());
+ IASTNode[] functionDeclarators = functionDeclarationBinding.getDeclarations();
+ assertEquals(1, functionDeclarators.length);
+ assertInstance(functionDeclarators[0], ICPPASTFunctionDeclarator.class);
+ assertVirtualSpecifiers((ICPPASTFunctionDeclarator)functionDeclarators[0], false, true);
+
+ CPPMethod functionDefinitionBinding = bindingHelper.assertNonProblem("mFuncDef()", 8);
+ assertFalse(functionDefinitionBinding.isOverride());
+ assertTrue(functionDefinitionBinding.isFinal());
+ IASTFunctionDeclarator declarator = functionDefinitionBinding.getDefinition();
+ assertInstance(declarator, ICPPASTFunctionDeclarator.class);
+ assertVirtualSpecifiers((ICPPASTFunctionDeclarator)declarator, false, true);
+ }
+
+ // struct Base {
+ // virtual void mFuncDecl();
+ // virtual void mFuncDef(){}
+ // };
+ // struct S : public Base {
+ // void mFuncDecl() override;
+ // void mFuncDef() override {}
+ // };
+ public void testOverrideFunction() throws Exception {
+ String code = getAboveComment();
+ parseAndCheckBindings(code);
+
+ BindingAssertionHelper bindingHelper = new BindingAssertionHelper(code, true);
+
+ CPPMethod functionDeclarationBinding = bindingHelper.assertNonProblem("mFuncDecl() override", 9);
+ assertTrue(functionDeclarationBinding.isOverride());
+ assertFalse(functionDeclarationBinding.isFinal());
+ IASTDeclarator[] functionDeclarators = functionDeclarationBinding.getDeclarations();
+ assertEquals(1, functionDeclarators.length);
+ assertInstance(functionDeclarators[0], ICPPASTFunctionDeclarator.class);
+ assertVirtualSpecifiers((ICPPASTFunctionDeclarator)functionDeclarators[0], true, false);
+
+ CPPMethod functionDefinitionBinding = bindingHelper.assertNonProblem("mFuncDef() override", 8);
+ assertTrue(functionDefinitionBinding.isOverride());
+ assertFalse(functionDefinitionBinding.isFinal());
+ IASTFunctionDeclarator declarator = functionDefinitionBinding.getDefinition();
+ assertInstance(declarator, ICPPASTFunctionDeclarator.class);
+ assertVirtualSpecifiers((ICPPASTFunctionDeclarator)declarator, true, false);
+ }
+
+ // struct Base {
+ // virtual void mFuncDecl();
+ // virtual void mFuncDef(){}
+ // };
+ // struct S : public Base {
+ // void mFuncDecl() final override;
+ // void mFuncDef() final override {}
+ // };
+ public void testOverrideFinalFunction() throws Exception {
+ String code = getAboveComment();
+ parseAndCheckBindings(code);
+
+ BindingAssertionHelper bindingHelper = new BindingAssertionHelper(code, true);
+
+ CPPMethod functionDeclarationBinding = bindingHelper.assertNonProblem("mFuncDecl() final", 9);
+ assertTrue(functionDeclarationBinding.isOverride());
+ assertTrue(functionDeclarationBinding.isFinal());
+ IASTDeclarator[] functionDeclarators = functionDeclarationBinding.getDeclarations();
+ assertEquals(1, functionDeclarators.length);
+ assertInstance(functionDeclarators[0], ICPPASTFunctionDeclarator.class);
+ assertVirtualSpecifiers((ICPPASTFunctionDeclarator)functionDeclarators[0], true, true);
+
+ CPPMethod functionDefinitionBinding = bindingHelper.assertNonProblem("mFuncDef() final", 8);
+ assertTrue(functionDefinitionBinding.isOverride());
+ assertTrue(functionDefinitionBinding.isFinal());
+ IASTFunctionDeclarator declarator = functionDefinitionBinding.getDefinition();
+ assertInstance(declarator, ICPPASTFunctionDeclarator.class);
+ assertVirtualSpecifiers((ICPPASTFunctionDeclarator)declarator, true, true);
+ }
+
+ private void assertVirtualSpecifiers(ICPPASTFunctionDeclarator declarator, boolean expectOverride, boolean expectFinal) {
+ assertEquals(expectOverride, declarator.isOverride());
+ assertEquals(expectFinal, declarator.isFinal());
+ }
+
+ // struct Base {
+ // };
+ // struct S final : public Base {
+ // };
+ public void testFinalClass() throws Exception {
+ String code = getAboveComment();
+ parseAndCheckBindings(code);
+
+ BindingAssertionHelper bh = new BindingAssertionHelper(code, true);
+
+ CPPClassType structBase = bh.assertNonProblem("Base {", 4);
+ assertFalse(structBase.isFinal());
+ IASTNode baseDefinitionName = structBase.getDefinition();
+ IASTNode baseDefinition = baseDefinitionName.getParent();
+ assertInstance(baseDefinition, ICPPASTCompositeTypeSpecifier.class);
+ assertFalse(((ICPPASTCompositeTypeSpecifier)baseDefinition).isFinal());
+
+ CPPClassType structS = bh.assertNonProblem("S", 1);
+ assertTrue(structS.isFinal());
+ IASTNode sDefinitionName = structS.getDefinition();
+ IASTNode sDefinition = sDefinitionName.getParent();
+ assertInstance(sDefinition, ICPPASTCompositeTypeSpecifier.class);
+ assertTrue(((ICPPASTCompositeTypeSpecifier)sDefinition).isFinal());
+ }
+
+
+ // struct S{
+ // template<typename T>
+ // void foo(T t) final {
+ // }
+ // };
+ //
+ // int main() {
+ // S s;
+ // s.foo(1);
+ // }
+ public void testFinalTemplateMethod() throws Exception {
+ String code = getAboveComment();
+ parseAndCheckBindings(code);
+
+ BindingAssertionHelper bindingHelper = new BindingAssertionHelper(code, true);
+
+ ICPPMethod fooTemplate = bindingHelper.assertNonProblem("foo(T", 3);
+ assertFalse(fooTemplate.isOverride());
+ assertTrue(fooTemplate.isFinal());
+ }
+
+ // void foo(){
+ // int final, override;
+ // final = 4;
+ // override = 2;
+ // }
+ public void testFinalAndOverrideVariables() throws Exception {
+ parseAndCheckBindings();
+ }
+
+ // struct S{
+ // int i;
+ // };
+ // void foo(struct S final){
+ // final.i = 23;
+ // }
+ public void testFinalParameter() throws Exception {
+ parseAndCheckBindings();
+ }
}
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ClassTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ClassTests.java
index 19bf159..8be5291 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ClassTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ClassTests.java
@@ -6,9 +6,10 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * QNX - Initial API and implementation
- * Markus Schorn (Wind River Systems)
- * IBM Corporation
+ * QNX - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * IBM Corporation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.pdom.tests;
@@ -232,4 +233,14 @@ public class ClassTests extends PDOMTestBase {
assertTrue(bindings[0] instanceof ICPPClassType);
return (ICPPClassType) bindings[0];
}
+
+ public void testFinalClass() throws Exception {
+ char[][] name = {"E".toCharArray()};
+ IBinding[] bindings = pdom.findBindings(name, IndexFilter.ALL, npm());
+ assertEquals(1, bindings.length);
+ assertInstance(bindings[0], ICPPClassType.class);
+ ICPPClassType classBinding = (ICPPClassType) bindings[0];
+
+ assertTrue(classBinding.isFinal());
+ }
}
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java
index 088fc7b..e47de9c 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.pdom.tests;
@@ -302,4 +303,31 @@ public class MethodTests extends PDOMTestBase {
assertEquals(IBasicType.t_int, Math.min(t1, t2));
assertEquals(IBasicType.t_double, Math.max(t1, t2));
}
+
+ public void testVirtualMemberFunction() throws Exception {
+ IBinding[] bindings = findQualifiedName(pdom, "E::virtualMemberFunction");
+ assertEquals(1, bindings.length);
+ assertInstance(bindings[0], ICPPMethod.class);
+ ICPPMethod virtMemFun = (ICPPMethod) bindings[0];
+ assertFalse(virtMemFun.isOverride());
+ assertFalse(virtMemFun.isFinal());
+ }
+
+ public void testOverrideVirtualMemberFunction() throws Exception {
+ IBinding[] bindings = findQualifiedName(pdom, "F::virtualMemberFunction");
+ assertEquals(1, bindings.length);
+ assertInstance(bindings[0], ICPPMethod.class);
+ ICPPMethod virtMemFun = (ICPPMethod) bindings[0];
+ assertTrue(virtMemFun.isOverride());
+ assertFalse(virtMemFun.isFinal());
+ }
+
+ public void testOverrideFinalVirtualMemberFunction() throws Exception {
+ IBinding[] bindings = findQualifiedName(pdom, "G::virtualMemberFunction");
+ assertEquals(1, bindings.length);
+ assertInstance(bindings[0], ICPPMethod.class);
+ ICPPMethod virtMemFun = (ICPPMethod) bindings[0];
+ assertTrue(virtMemFun.isOverride());
+ assertTrue(virtMemFun.isFinal());
+ }
}
diff --git a/core/org.eclipse.cdt.core.tests/resources/pdomtests/classTests/class.cpp b/core/org.eclipse.cdt.core.tests/resources/pdomtests/classTests/class.cpp
index 401a5a2..6a606e8 100644
--- a/core/org.eclipse.cdt.core.tests/resources/pdomtests/classTests/class.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/pdomtests/classTests/class.cpp
@@ -32,3 +32,6 @@ class D {
public:
D(D &) {}
};
+
+class E final : public A {
+};
diff --git a/core/org.eclipse.cdt.core.tests/resources/pdomtests/methodTests/inheritance.cpp b/core/org.eclipse.cdt.core.tests/resources/pdomtests/methodTests/inheritance.cpp
index 9c218bf..06996a5 100644
--- a/core/org.eclipse.cdt.core.tests/resources/pdomtests/methodTests/inheritance.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/pdomtests/methodTests/inheritance.cpp
@@ -39,6 +39,18 @@ struct B {
struct D : public A, public B {};
+struct E {
+ virtual void virtualMemberFunction(){}
+};
+
+struct F : public E {
+ void virtualMemberFunction() override{}
+};
+
+struct G : public F {
+ void virtualMemberFunction() override final{}
+};
+
class Class2 : public Class1 {
public:
void pureVirtualMethod();
diff --git a/core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterDeclSpecTestSource.awts b/core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterDeclSpecTestSource.awts
index 542373f..bb20b9e 100644
--- a/core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterDeclSpecTestSource.awts
+++ b/core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterDeclSpecTestSource.awts
@@ -181,3 +181,11 @@ decltype(i) j = 3;
int i;
typeof i j = 3;
+//!CPPCompositeTypeSpecifier declared final
+//%CPP
+class Base
+{
+};
+class TestClass final : public Base
+{
+};
diff --git a/core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterDeclaratorTestSource.awts b/core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterDeclaratorTestSource.awts
index 97c1ba1..bb26697 100644
--- a/core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterDeclaratorTestSource.awts
+++ b/core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterDeclaratorTestSource.awts
@@ -117,3 +117,32 @@ int&& foo(int&& a)
char&& b;
}
+//!ICPPASTFunctionDeclarator in member function declared final
+//%CPP
+struct S
+{
+ virtual void memFun() final;
+};
+
+//!ICPPASTFunctionDeclarator in member function declared override
+//%CPP
+struct S
+{
+ virtual void memFun() override;
+};
+
+//!ICPPASTFunctionDeclarator in member function declared override final
+//%CPP
+struct S
+{
+ virtual void memFun() override final;
+};
+
+//!ICPPASTFunctionDeclarator in member function definition declared final
+//%CPP
+struct S
+{
+ virtual void memFun() final
+ {
+ }
+}; \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core/.settings/.api_filters b/core/org.eclipse.cdt.core/.settings/.api_filters
index 736390c..d0bd80c 100644
--- a/core/org.eclipse.cdt.core/.settings/.api_filters
+++ b/core/org.eclipse.cdt.core/.settings/.api_filters
@@ -99,4 +99,16 @@
</message_arguments>
</filter>
</resource>
+ <resource path="parser/org/eclipse/cdt/core/parser/Keywords.java" type="org.eclipse.cdt.core.parser.Keywords">
+ <filter id="1143996420">
+ <message_arguments>
+ <message_argument value="cFINAL"/>
+ </message_arguments>
+ </filter>
+ <filter id="1143996420">
+ <message_arguments>
+ <message_argument value="cOVERRIDE"/>
+ </message_arguments>
+ </filter>
+ </resource>
</component>
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCompositeTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCompositeTypeSpecifier.java
index edc38b6..27c19b5 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCompositeTypeSpecifier.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCompositeTypeSpecifier.java
@@ -8,7 +8,8 @@
* Contributors:
* John Camelon (IBM) - Initial API and implementation
* Markus Schorn (Wind River Systems)
- *******************************************************************************/
+ * Thomas Corbat (IFS)
+******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
@@ -138,4 +139,16 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie
*/
@Override
public ICPPASTCompositeTypeSpecifier copy(CopyStyle style);
+
+ /**
+ * Queries whether the type is final.
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public boolean isFinal();
+
+ /**
+ * Sets whether the type is final.
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public void setFinal(boolean isFinal);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTFunctionDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTFunctionDeclarator.java
index 4a6c53e..19659f8 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTFunctionDeclarator.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTFunctionDeclarator.java
@@ -1,14 +1,15 @@
/*******************************************************************************
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
*
- * Contributors:
- * IBM - Initial API and implementation
- * Markus Schorn (Wind River Systems)
- * Sergey Prigogin (Google)
+ * Contributors:
+ * IBM - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Sergey Prigogin (Google)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
@@ -162,4 +163,28 @@ public interface ICPPASTFunctionDeclarator extends IASTStandardFunctionDeclarato
*/
@Override
public ICPPASTFunctionDeclarator copy(CopyStyle style);
+
+ /**
+ * Returns whether this function is declared override.
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public boolean isOverride();
+
+ /**
+ * Sets whether this function is declared override.
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public void setOverride(boolean isOverride);
+
+ /**
+ * Returns whether this function is declared final.
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public boolean isFinal();
+
+ /**
+ * Sets whether this function is declared final.
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public void setFinal(boolean isFinal);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java
index 1fc4b2d..6001441 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.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
@@ -7,7 +7,8 @@
*
* Contributors:
* Doug Schaefer (IBM) - Initial API and implementation
- *******************************************************************************/
+ * Thomas Corbat (IFS)
+ ******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -99,4 +100,11 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding {
* Returns an array of nested classes/structures
*/
public ICPPClassType[] getNestedClasses();
+
+ /**
+ * Returns whether this type is declared final.
+ *
+ * @since 5.5
+ */
+ public boolean isFinal();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMethod.java
index 5366f88..70be18a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMethod.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMethod.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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM - Initial API and implementation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
@@ -49,4 +50,16 @@ public interface ICPPMethod extends ICPPFunction, ICPPMember {
* @since 5.1
*/
public boolean isPureVirtual();
+
+ /**
+ * Returns whether this method is declared override.
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public boolean isOverride();
+
+ /**
+ * Returns whether this method is declared final.
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public boolean isFinal();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Keywords.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Keywords.java
index 3d8defd..5832d9e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Keywords.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Keywords.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2010 IBM Corporation and others.
+ * Copyright (c) 2002, 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
@@ -9,6 +9,7 @@
* John Camelon (IBM Rational Software) - Initial API and implementation
* Anton Leherbauer (Wind River Systems)
* Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.core.parser;
@@ -167,6 +168,7 @@ public class Keywords {
public static final char[] cFALSE = "false".toCharArray();
public static final char[] cFLOAT = "float".toCharArray();
public static final char[] cFOR = "for".toCharArray();
+ public static final char[] cFINAL = "final".toCharArray();
public static final char[] cFRIEND = "friend".toCharArray();
public static final char[] cGOTO = "goto".toCharArray();
public static final char[] cIF = "if".toCharArray();
@@ -185,6 +187,7 @@ public class Keywords {
public static final char[] cOPERATOR = "operator".toCharArray();
public static final char[] cOR = "or".toCharArray();
public static final char[] cOR_EQ = "or_eq".toCharArray();
+ public static final char[] cOVERRIDE = "override".toCharArray();
public static final char[] cPRIVATE = "private".toCharArray();
public static final char[] cPROTECTED = "protected".toCharArray();
public static final char[] cPUBLIC = "public".toCharArray();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTCompositeTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTCompositeTypeSpecifier.java
index 964f202..f979a50 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTCompositeTypeSpecifier.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTCompositeTypeSpecifier.java
@@ -8,6 +8,7 @@
* Contributors:
* John Camelon (IBM) - Initial API and implementation
* Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -36,6 +37,7 @@ public class CPPASTCompositeTypeSpecifier extends CPPASTBaseDeclSpecifier
private ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier[] baseSpecs;
private int baseSpecsPos = -1;
private boolean fAmbiguitiesResolved;
+ private boolean isFinal;
public CPPASTCompositeTypeSpecifier() {
}
@@ -65,6 +67,7 @@ public class CPPASTCompositeTypeSpecifier extends CPPASTBaseDeclSpecifier
copy.addMemberDeclaration(member == null ? null : member.copy(style));
for (ICPPASTBaseSpecifier baseSpecifier : getBaseSpecifiers())
copy.addBaseSpecifier(baseSpecifier == null ? null : baseSpecifier.copy(style));
+ copy.isFinal = isFinal;
return super.copy(copy, style);
}
@@ -216,4 +219,15 @@ public class CPPASTCompositeTypeSpecifier extends CPPASTBaseDeclSpecifier
}
}
}
+
+ @Override
+ public boolean isFinal() {
+ return isFinal;
+ }
+
+ @Override
+ public void setFinal(boolean value) {
+ assertNotFrozen();
+ isFinal = value;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java
index acdd8d9..b07eb82 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java
@@ -9,6 +9,7 @@
* IBM - Initial API and implementation
* Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -54,6 +55,8 @@ public class CPPASTFunctionDeclarator extends CPPASTDeclarator implements ICPPAS
private boolean isVolatile;
private boolean isConst;
private boolean isMutable;
+ private boolean isOverride;
+ private boolean isFinal;
private ICPPFunctionScope scope;
@@ -78,6 +81,8 @@ public class CPPASTFunctionDeclarator extends CPPASTDeclarator implements ICPPAS
copy.isVolatile = isVolatile;
copy.isConst = isConst;
copy.isMutable = isMutable;
+ copy.isOverride = isOverride;
+ copy.isFinal = isFinal;
for (IASTParameterDeclaration param : getParameters()) {
copy.addParameterDeclaration(param == null ? null : param.copy(style));
@@ -306,4 +311,26 @@ public class CPPASTFunctionDeclarator extends CPPASTDeclarator implements ICPPAS
}
assert false;
}
+
+ @Override
+ public boolean isOverride() {
+ return isOverride;
+ }
+
+ @Override
+ public void setOverride(boolean value) {
+ assertNotFrozen();
+ this.isOverride = value;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return isFinal;
+ }
+
+ @Override
+ public void setFinal(boolean value) {
+ assertNotFrozen();
+ this.isFinal = value;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java
index 7c5327c..468edd0 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java
@@ -9,6 +9,7 @@
* Andrew Niefer (IBM) - Initial API and implementation
* Bryan Wilkinson (QNX)
* Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -124,6 +125,16 @@ public class CPPClassSpecialization extends CPPSpecialization
public ICPPFunctionType getType() {
return new ProblemFunctionType(getID());
}
+
+ @Override
+ public boolean isOverride() {
+ return false;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}
private ICPPClassSpecializationScope specScope;
@@ -422,4 +433,13 @@ public class CPPClassSpecialization extends CPPSpecialization
return ((ICPPClassType) owner1).isSameType((ICPPClassType) owner2);
}
+
+ @Override
+ public boolean isFinal() {
+ ICPPASTCompositeTypeSpecifier typeSpecifier = getCompositeTypeSpecifier();
+ if (typeSpecifier != null) {
+ return typeSpecifier.isFinal();
+ }
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java
index b509345..aab5db6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java
@@ -1,15 +1,16 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM - Initial API and implementation
- * Bryan Wilkinson (QNX)
- * Markus Schorn (Wind River Systems)
- * Andrew Ferguson (Symbian)
+ * IBM - Initial API and implementation
+ * Bryan Wilkinson (QNX)
+ * Markus Schorn (Wind River Systems)
+ * Andrew Ferguson (Symbian)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -244,4 +245,13 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements ICPPClass
}
return null;
}
+
+ @Override
+ public boolean isFinal() {
+ ICPPASTCompositeTypeSpecifier typeSpecifier = getCompositeTypeSpecifier();
+ if(typeSpecifier != null){
+ return typeSpecifier.isFinal();
+ }
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java
index b6a32c6..7d88b89 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java
@@ -105,6 +105,10 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
public ICPPClassType[] getNestedClasses() {
return ICPPClassType.EMPTY_CLASS_ARRAY;
}
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}
private IASTName definition;
@@ -393,4 +397,13 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
}
return false;
}
+
+ @Override
+ public boolean isFinal() {
+ ICPPASTCompositeTypeSpecifier typeSpecifier = getCompositeTypeSpecifier();
+ if (typeSpecifier != null) {
+ return typeSpecifier.isFinal();
+ }
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java
index 128614a..65df646 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Wind River Systems, Inc. and others.
+ * Copyright (c) 2010, 2012 Wind River Systems, Inc. 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:
* Markus Schorn (Wind River Systems) - initial API and implementation
* Jens Elmenthaler - http://bugs.eclipse.org/173458 (camel case completion)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -338,6 +339,11 @@ public class CPPClosureType extends PlatformObject implements ICPPClassType, ICP
public void addDeclaration(IASTNode node) {
}
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
+
private final class ClassScope implements ICPPClassScope {
@Override
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitMethod.java
index bf44bc2..3425de5 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitMethod.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitMethod.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;
@@ -188,6 +189,16 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
}
@Override
+ public boolean isOverride() {
+ return false;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
+
+ @Override
public IBinding getOwner() {
return getClassOwner();
}
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
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodInstance.java
index 611539c..06f157e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodInstance.java
@@ -1,13 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Andrew Niefer (IBM) - Initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * Andrew Niefer (IBM) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -76,4 +77,14 @@ public class CPPMethodInstance extends CPPFunctionInstance implements ICPPMethod
public boolean isImplicit() {
return false;
}
+
+ @Override
+ public boolean isOverride() {
+ return ((ICPPMethod)getTemplateDefinition()).isOverride();
+ }
+
+ @Override
+ public boolean isFinal() {
+ return ((ICPPMethod)getTemplateDefinition()).isFinal();
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodSpecialization.java
index 988ae58..b14bc0b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodSpecialization.java
@@ -9,6 +9,7 @@
* Andrew Niefer (IBM) - Initial API and implementation
* Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -106,6 +107,16 @@ public class CPPMethodSpecialization extends CPPFunctionSpecialization implement
}
@Override
+ public boolean isOverride() {
+ return false;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
+
+ @Override
public IType[] getExceptionSpecification(IASTNode point) {
if (isImplicit()) {
return ClassTypeHelper.getInheritedExceptionSpecification(this, point);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplate.java
index e2b57e0..3e0b38f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplate.java
@@ -1,13 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Andrew Niefer (IBM) - Initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * Andrew Niefer (IBM) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -205,21 +206,51 @@ public class CPPMethodTemplate extends CPPFunctionTemplate implements ICPPMethod
@Override
public boolean isPureVirtual() {
+ ICPPASTFunctionDeclarator functionDeclarator = findFunctionDeclarator();
+ if(functionDeclarator != null){
+ return functionDeclarator.isPureVirtual();
+ }
+ return false;
+ }
+
+ @Override
+ public boolean isOverride() {
+ ICPPASTFunctionDeclarator functionDeclarator = findFunctionDeclarator();
+ if(functionDeclarator != null){
+ return functionDeclarator.isOverride();
+ }
+ return false;
+ }
+
+ @Override
+ public boolean isFinal() {
+ ICPPASTFunctionDeclarator functionDeclarator = findFunctionDeclarator();
+ if(functionDeclarator != null){
+ return functionDeclarator.isFinal();
+ }
+ return false;
+ }
+
+ private ICPPASTFunctionDeclarator findFunctionDeclarator() {
+ IASTName target = null;
if (declarations != null && declarations.length > 0) {
- IASTName decl= declarations[0];
- if (decl != null) {
- IASTNode parent = decl.getParent();
- while (!(parent instanceof IASTDeclarator) && parent != null)
- parent = parent.getParent();
-
- if (parent instanceof IASTDeclarator) {
- IASTDeclarator dtor= ASTQueries.findTypeRelevantDeclarator((IASTDeclarator) parent);
- if (dtor instanceof ICPPASTFunctionDeclarator) {
- return ((ICPPASTFunctionDeclarator) dtor).isPureVirtual();
- }
+ target = declarations[0];
+ } else {
+ target = definition;
+ }
+ if (target != null) {
+ IASTNode parent = target.getParent();
+ while (!(parent instanceof IASTDeclarator) && parent != null)
+ parent = parent.getParent();
+
+ if (parent instanceof IASTDeclarator) {
+ IASTDeclarator dtor = ASTQueries
+ .findTypeRelevantDeclarator((IASTDeclarator) parent);
+ if (dtor instanceof ICPPASTFunctionDeclarator) {
+ return (ICPPASTFunctionDeclarator) dtor;
}
}
}
- return false;
+ return null;
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplateSpecialization.java
index f257ba4..83ae82c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplateSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplateSpecialization.java
@@ -1,13 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Andrew Niefer (IBM) - Initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * Andrew Niefer (IBM) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -83,4 +84,13 @@ public class CPPMethodTemplateSpecialization extends CPPFunctionTemplateSpeciali
return false;
}
+ @Override
+ public boolean isOverride() {
+ return false;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java
index bc070ed..6b3fd5c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -9,6 +9,7 @@
* Andrew Niefer (IBM Corporation) - initial API and implementation
* Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -245,4 +246,9 @@ public class CPPTemplateTemplateParameter extends CPPTemplateParameter implement
public ICPPDeferredClassInstance asDeferredInstance() {
return null;
}
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java
index ad24ae0..4ee2e40 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.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
@@ -9,6 +9,7 @@
* Andrew Niefer (IBM Corporation) - initial API and implementation
* Sergey Prigogin (Google)
* Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -129,4 +130,9 @@ public class CPPUnknownClass extends CPPUnknownBinding implements ICPPUnknownCla
public String toString() {
return ASTTypeUtil.getType(this);
}
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownConstructor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownConstructor.java
index 2c0e8bc..4342c90 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownConstructor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownConstructor.java
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 Wind River Systems, Inc. and others.
+ * Copyright (c) 2008, 2012 Wind River Systems, Inc. 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
+ * Markus Schorn - initial API and implementation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -57,4 +58,14 @@ public class CPPUnknownConstructor extends CPPUnknownFunction implements ICPPCon
public int getVisibility() {
return v_public;
}
+
+ @Override
+ public boolean isOverride() {
+ return false;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
index 0f2834e..6c3d921 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
@@ -18,6 +18,7 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -132,6 +133,7 @@ import org.eclipse.cdt.core.parser.IParserLogService;
import org.eclipse.cdt.core.parser.IProblem;
import org.eclipse.cdt.core.parser.IScanner;
import org.eclipse.cdt.core.parser.IToken;
+import org.eclipse.cdt.core.parser.Keywords;
import org.eclipse.cdt.core.parser.ParserMode;
import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
@@ -3295,8 +3297,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
* declarator ("=" initializerClause | "(" expressionList ")")?
*
* @return declarator that this parsing produced.
- * @throws BacktrackException
- * request a backtrack
+ * @throws BacktrackException request a backtrack
* @throws FoundAggregateInitializer
*/
private IASTDeclarator initDeclarator(DtorStrategy strategy, IASTDeclSpecifier declspec, DeclarationOptions option)
@@ -3305,18 +3306,21 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
if (option.fAllowInitializer) {
final IASTDeclarator typeRelevantDtor = ASTQueries.findTypeRelevantDeclarator(dtor);
if (option != DeclarationOptions.PARAMETER && typeRelevantDtor instanceof IASTFunctionDeclarator) {
- // Function declarations don't have initializers
- // For member functions we need to consider pure-virtual syntax
- if (option == DeclarationOptions.CPP_MEMBER && LTcatchEOF(1) == IToken.tASSIGN
- && LTcatchEOF(2) == IToken.tINTEGER) {
- consume();
- IToken t = consume();
- char[] image = t.getCharImage();
- if (image.length != 1 || image[0] != '0') {
- throwBacktrack(t);
+ // Function declarations don't have initializers.
+ // For member functions we need to consider virtual specifiers and pure-virtual syntax.
+ if (option == DeclarationOptions.CPP_MEMBER) {
+ optionalVirtSpecifierSeq((ICPPASTFunctionDeclarator) typeRelevantDtor);
+ int lt1 = LTcatchEOF(1);
+ if (lt1 == IToken.tASSIGN && LTcatchEOF(2) == IToken.tINTEGER) {
+ consume();
+ IToken t = consume();
+ char[] image = t.getCharImage();
+ if (image.length != 1 || image[0] != '0') {
+ throwBacktrack(t);
+ }
+ ((ICPPASTFunctionDeclarator) typeRelevantDtor).setPureVirtual(true);
+ adjustEndOffset(dtor, t.getEndOffset()); // We can only adjust the offset of the outermost dtor.
}
- ((ICPPASTFunctionDeclarator) typeRelevantDtor).setPureVirtual(true);
- adjustEndOffset(dtor, t.getEndOffset()); // we can only adjust the offset of the outermost dtor.
}
} else {
if (LTcatchEOF(1) == IToken.tASSIGN && LTcatchEOF(2) == IToken.tLBRACE)
@@ -3346,7 +3350,37 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
return dtor;
}
- /**
+ /**
+ * virt-specifier-seq
+ * virt-specifier
+ * virt-specifier-seq virt-specifier
+ *
+ * virt-specifier:
+ * override
+ * final
+ * @throws EndOfFileException
+ * @throws BacktrackException
+ */
+ private void optionalVirtSpecifierSeq(ICPPASTFunctionDeclarator typeRelevantDtor)
+ throws EndOfFileException, BacktrackException {
+ while (true) {
+ IToken token = LAcatchEOF(1);
+ if (token.getType() != IToken.tIDENTIFIER)
+ break;
+ char[] tokenImage = token.getCharImage();
+ if (Arrays.equals(Keywords.cOVERRIDE, tokenImage)) {
+ consume();
+ typeRelevantDtor.setOverride(true);
+ } else if (Arrays.equals(Keywords.cFINAL, tokenImage)) {
+ consume();
+ typeRelevantDtor.setFinal(true);
+ } else {
+ break;
+ }
+ }
+ }
+
+ /**
* initializer:
* brace-or-equal-initializer
* ( expression-list )
@@ -4070,6 +4104,11 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
ICPPASTCompositeTypeSpecifier astClassSpecifier = nodeFactory.newCompositeTypeSpecifier(classKind, name);
+ // class virt specifier
+ if(LT(1) == IToken.tIDENTIFIER) {
+ classVirtSpecifier(astClassSpecifier);
+ }
+
// base clause
if (LT(1) == IToken.tCOLON) {
baseClause(astClassSpecifier);
@@ -4134,7 +4173,22 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
consume();
}
}
-
+
+ /**
+ * Parse a class virtual specifier for a class specification.
+ * class-virt-specifier:
+ * final
+ * @param astClassSpecifier
+ */
+ private void classVirtSpecifier(ICPPASTCompositeTypeSpecifier astClassSpecifier) throws EndOfFileException, BacktrackException {
+ IToken token = LA();
+ char[] tokenImage = token.getCharImage();
+ if(token.getType() == IToken.tIDENTIFIER && Arrays.equals(Keywords.cFINAL, tokenImage)){
+ consume();
+ astClassSpecifier.setFinal(true);
+ }
+ }
+
/**
* base-specifier:
* ::? nested-name-specifier? class-name
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclSpecWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclSpecWriter.java
index dd5de13..e1ddfb4 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclSpecWriter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclSpecWriter.java
@@ -9,6 +9,7 @@
* Contributors:
* Institute for Software - initial API and implementation
* Sergey Prigogin (Google)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
@@ -230,6 +231,10 @@ public class DeclSpecWriter extends NodeWriter {
compDeclSpec.getName().accept(visitor);
if (compDeclSpec instanceof ICPPASTCompositeTypeSpecifier) {
ICPPASTCompositeTypeSpecifier cppComp = (ICPPASTCompositeTypeSpecifier) compDeclSpec;
+ if (cppComp.isFinal()) {
+ scribe.printSpace();
+ scribe.print(Keywords.cFINAL);
+ }
ICPPASTBaseSpecifier[] baseSpecifiers = cppComp.getBaseSpecifiers();
if (baseSpecifiers.length > 0) {
scribe.print(SPACE_COLON_SPACE);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java
index c5e1c1c..3839dce 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java
@@ -10,6 +10,7 @@
* Institute for Software - initial API and implementation
* Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
@@ -141,6 +142,14 @@ public class DeclaratorWriter extends NodeWriter {
scribe.printSpace();
scribe.print(Keywords.MUTABLE);
}
+ if (funcDec.isOverride()) {
+ scribe.printSpace();
+ scribe.print(Keywords.cOVERRIDE);
+ }
+ if (funcDec.isFinal()) {
+ scribe.printSpace();
+ scribe.print(Keywords.cFINAL);
+ }
if (funcDec.isPureVirtual()) {
scribe.print(PURE_VIRTUAL);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java
index 9866bac..f147272 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java
@@ -9,6 +9,7 @@
* Andrew Ferguson (Symbian) - Initial implementation
* Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
@@ -184,4 +185,9 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
}
return result;
}
+
+ @Override
+ public boolean isFinal() {
+ return ((ICPPClassType) rbinding).isFinal();
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java
index 79d262e..f134b2c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2012 Symbian Software Systems 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Andrew Ferguson (Symbian) - Initial implementation
+ * Andrew Ferguson (Symbian) - Initial implementation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
@@ -24,37 +25,47 @@ class CompositeCPPMethod extends CompositeCPPFunction implements ICPPMethod {
@Override
public boolean isDestructor() {
- return ((ICPPMethod)rbinding).isDestructor();
+ return ((ICPPMethod) rbinding).isDestructor();
}
@Override
public boolean isImplicit() {
- return ((ICPPMethod)rbinding).isImplicit();
+ return ((ICPPMethod) rbinding).isImplicit();
}
@Override
public boolean isExplicit() {
- return ((ICPPMethod)rbinding).isExplicit();
+ return ((ICPPMethod) rbinding).isExplicit();
}
@Override
public boolean isVirtual() {
- return ((ICPPMethod)rbinding).isVirtual();
+ return ((ICPPMethod) rbinding).isVirtual();
}
@Override
public ICPPClassType getClassOwner() {
- IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod)rbinding).getClassOwner();
+ IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod) rbinding).getClassOwner();
return (ICPPClassType) cf.getCompositeBinding(rowner);
}
@Override
public int getVisibility() {
- return ((ICPPMethod)rbinding).getVisibility();
+ return ((ICPPMethod) rbinding).getVisibility();
}
@Override
public boolean isPureVirtual() {
- return ((ICPPMethod)rbinding).isPureVirtual();
+ return ((ICPPMethod) rbinding).isPureVirtual();
+ }
+
+ @Override
+ public boolean isOverride() {
+ return ((ICPPMethod) rbinding).isOverride();
+ }
+
+ @Override
+ public boolean isFinal() {
+ return ((ICPPMethod) rbinding).isFinal();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodInstance.java
index ca7964b..773beb6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodInstance.java
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2012 Symbian Software Systems 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Andrew Ferguson (Symbian) - Initial implementation
+ * Andrew Ferguson (Symbian) - Initial implementation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
@@ -23,37 +24,47 @@ public class CompositeCPPMethodInstance extends CompositeCPPFunctionInstance imp
@Override
public boolean isDestructor() {
- return ((ICPPMethod)rbinding).isDestructor();
+ return ((ICPPMethod) rbinding).isDestructor();
}
@Override
public boolean isImplicit() {
- return ((ICPPMethod)rbinding).isImplicit();
+ return ((ICPPMethod) rbinding).isImplicit();
}
@Override
public boolean isExplicit() {
- return ((ICPPMethod)rbinding).isExplicit();
+ return ((ICPPMethod) rbinding).isExplicit();
}
@Override
public boolean isVirtual() {
- return ((ICPPMethod)rbinding).isDestructor();
+ return ((ICPPMethod) rbinding).isDestructor();
}
@Override
public ICPPClassType getClassOwner() {
- IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod)rbinding).getClassOwner();
+ IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod) rbinding).getClassOwner();
return (ICPPClassType) cf.getCompositeBinding(rowner);
}
@Override
public int getVisibility() {
- return ((ICPPMethod)rbinding).getVisibility();
+ return ((ICPPMethod) rbinding).getVisibility();
}
@Override
public boolean isPureVirtual() {
- return ((ICPPMethod)rbinding).isPureVirtual();
+ return ((ICPPMethod) rbinding).isPureVirtual();
+ }
+
+ @Override
+ public boolean isOverride() {
+ return ((ICPPMethod) rbinding).isOverride();
+ }
+
+ @Override
+ public boolean isFinal() {
+ return ((ICPPMethod) rbinding).isFinal();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodSpecialization.java
index 2f745ea..3bd9fc8 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodSpecialization.java
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2012 Symbian Software Systems 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Andrew Ferguson (Symbian) - Initial implementation
+ * Andrew Ferguson (Symbian) - Initial implementation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
@@ -16,45 +17,54 @@ import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
public class CompositeCPPMethodSpecialization extends CompositeCPPFunctionSpecialization
-implements ICPPMethod {
-
+ implements ICPPMethod {
public CompositeCPPMethodSpecialization(ICompositesFactory cf, ICPPMethod method) {
super(cf, method);
}
@Override
public boolean isDestructor() {
- return ((ICPPMethod)rbinding).isDestructor();
+ return ((ICPPMethod) rbinding).isDestructor();
}
@Override
public boolean isImplicit() {
- return ((ICPPMethod)rbinding).isImplicit();
+ return ((ICPPMethod) rbinding).isImplicit();
}
@Override
public boolean isExplicit() {
- return ((ICPPMethod)rbinding).isExplicit();
+ return ((ICPPMethod) rbinding).isExplicit();
}
@Override
public boolean isVirtual() {
- return ((ICPPMethod)rbinding).isVirtual();
+ return ((ICPPMethod) rbinding).isVirtual();
}
@Override
public ICPPClassType getClassOwner() {
- IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod)rbinding).getClassOwner();
+ IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod) rbinding).getClassOwner();
return (ICPPClassType) cf.getCompositeBinding(rowner);
}
@Override
public int getVisibility() {
- return ((ICPPMethod)rbinding).getVisibility();
+ return ((ICPPMethod) rbinding).getVisibility();
}
@Override
public boolean isPureVirtual() {
- return ((ICPPMethod)rbinding).isPureVirtual();
+ return ((ICPPMethod) rbinding).isPureVirtual();
+ }
+
+ @Override
+ public boolean isOverride() {
+ return ((ICPPMethod) rbinding).isOverride();
+ }
+
+ @Override
+ public boolean isFinal() {
+ return ((ICPPMethod) rbinding).isFinal();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplate.java
index f778d2d..bcad67b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplate.java
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2012 Symbian Software Systems 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Andrew Ferguson (Symbian) - Initial implementation
+ * Andrew Ferguson (Symbian) - Initial implementation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
@@ -23,39 +24,47 @@ public class CompositeCPPMethodTemplate extends CompositeCPPFunctionTemplate imp
@Override
public boolean isDestructor() {
- return ((ICPPMethod)rbinding).isDestructor();
+ return ((ICPPMethod) rbinding).isDestructor();
}
@Override
public boolean isImplicit() {
- return ((ICPPMethod)rbinding).isImplicit();
+ return ((ICPPMethod) rbinding).isImplicit();
}
@Override
public boolean isExplicit() {
- return ((ICPPMethod)rbinding).isExplicit();
+ return ((ICPPMethod) rbinding).isExplicit();
}
@Override
public boolean isVirtual() {
- return ((ICPPMethod)rbinding).isVirtual();
+ return ((ICPPMethod) rbinding).isVirtual();
}
@Override
public ICPPClassType getClassOwner() {
- IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod)rbinding).getClassOwner();
+ IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod) rbinding).getClassOwner();
return (ICPPClassType) cf.getCompositeBinding(rowner);
}
-
@Override
public int getVisibility() {
- return ((ICPPMethod)rbinding).getVisibility();
+ return ((ICPPMethod) rbinding).getVisibility();
}
@Override
public boolean isPureVirtual() {
- return ((ICPPMethod)rbinding).isPureVirtual();
+ return ((ICPPMethod) rbinding).isPureVirtual();
+ }
+
+ @Override
+ public boolean isOverride() {
+ return ((ICPPMethod) rbinding).isOverride();
}
+ @Override
+ public boolean isFinal() {
+ return ((ICPPMethod) rbinding).isFinal();
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplateSpecialization.java
index e67d4af..4c27406 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplateSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplateSpecialization.java
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2012 Symbian Software Systems 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Andrew Ferguson (Symbian) - Initial implementation
+ * Andrew Ferguson (Symbian) - Initial implementation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
@@ -17,47 +18,55 @@ import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
public class CompositeCPPMethodTemplateSpecialization
- extends CompositeCPPFunctionTemplateSpecialization
- implements ICPPMethod {
-
- public CompositeCPPMethodTemplateSpecialization(ICompositesFactory cf,
- ICPPFunction ft) {
+ extends CompositeCPPFunctionTemplateSpecialization
+ implements ICPPMethod {
+ public CompositeCPPMethodTemplateSpecialization(ICompositesFactory cf, ICPPFunction ft) {
super(cf, ft);
}
@Override
public boolean isDestructor() {
- return ((ICPPMethod)rbinding).isDestructor();
+ return ((ICPPMethod) rbinding).isDestructor();
}
@Override
public boolean isImplicit() {
- return ((ICPPMethod)rbinding).isImplicit();
+ return ((ICPPMethod) rbinding).isImplicit();
}
@Override
public boolean isExplicit() {
- return ((ICPPMethod)rbinding).isExplicit();
+ return ((ICPPMethod) rbinding).isExplicit();
}
@Override
public boolean isVirtual() {
- return ((ICPPMethod)rbinding).isVirtual();
+ return ((ICPPMethod) rbinding).isVirtual();
}
@Override
public ICPPClassType getClassOwner() {
- IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod)rbinding).getClassOwner();
+ IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod) rbinding).getClassOwner();
return (ICPPClassType) cf.getCompositeBinding(rowner);
}
@Override
public int getVisibility() {
- return ((ICPPMethod)rbinding).getVisibility();
+ return ((ICPPMethod) rbinding).getVisibility();
}
@Override
public boolean isPureVirtual() {
- return ((ICPPMethod)rbinding).isPureVirtual();
+ return ((ICPPMethod) rbinding).isPureVirtual();
+ }
+
+ @Override
+ public boolean isOverride() {
+ return ((ICPPMethod) rbinding).isOverride();
+ }
+
+ @Override
+ public boolean isFinal() {
+ return ((ICPPMethod) rbinding).isFinal();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTemplateTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTemplateTemplateParameter.java
index 9038f51..d7b1627 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTemplateTemplateParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTemplateTemplateParameter.java
@@ -1,13 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2012 Symbian Software Systems 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Andrew Ferguson (Symbian) - Initial implementation
- * Markus Schorn (Wind River Systems)
+ * Andrew Ferguson (Symbian) - Initial implementation
+ * Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
@@ -35,8 +36,7 @@ import org.eclipse.cdt.internal.core.index.IIndexType;
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
public class CompositeCPPTemplateTemplateParameter extends CompositeCPPBinding
- implements ICPPTemplateTemplateParameter, ICPPUnknownBinding, ICPPUnknownType, IIndexType {
-
+ implements ICPPTemplateTemplateParameter, ICPPUnknownBinding, ICPPUnknownType, IIndexType {
private ICPPScope unknownScope;
public CompositeCPPTemplateTemplateParameter(ICompositesFactory cf, ICPPTemplateTemplateParameter binding) {
@@ -45,33 +45,33 @@ public class CompositeCPPTemplateTemplateParameter extends CompositeCPPBinding
@Override
public IType getDefault() throws DOMException {
- IType preresult= ((ICPPTemplateTemplateParameter)rbinding).getDefault();
+ IType preresult= ((ICPPTemplateTemplateParameter) rbinding).getDefault();
return cf.getCompositeType(preresult);
}
@Override
public short getParameterPosition() {
- return ((ICPPTemplateParameter)rbinding).getParameterPosition();
+ return ((ICPPTemplateParameter) rbinding).getParameterPosition();
}
@Override
public short getTemplateNestingLevel() {
- return ((ICPPTemplateParameter)rbinding).getTemplateNestingLevel();
+ return ((ICPPTemplateParameter) rbinding).getTemplateNestingLevel();
}
@Override
public int getParameterID() {
- return ((ICPPTemplateParameter)rbinding).getParameterID();
+ return ((ICPPTemplateParameter) rbinding).getParameterID();
}
@Override
public boolean isParameterPack() {
- return ((ICPPTemplateParameter)rbinding).isParameterPack();
+ return ((ICPPTemplateParameter) rbinding).isParameterPack();
}
@Override
public boolean isSameType(IType type) {
- return ((IType)rbinding).isSameType(type);
+ return ((IType) rbinding).isSameType(type);
}
@Override
@@ -95,7 +95,7 @@ public class CompositeCPPTemplateTemplateParameter extends CompositeCPPBinding
@Override
public ICPPTemplateArgument getDefaultValue() {
try {
- return TemplateInstanceUtil.convert(cf, ((ICPPTemplateTemplateParameter)rbinding).getDefaultValue());
+ return TemplateInstanceUtil.convert(cf, ((ICPPTemplateTemplateParameter) rbinding).getDefaultValue());
} catch (DOMException e) {
return null;
}
@@ -103,7 +103,7 @@ public class CompositeCPPTemplateTemplateParameter extends CompositeCPPBinding
@Override
public ICPPTemplateParameter[] getTemplateParameters() {
- return TemplateInstanceUtil.convert(cf, ((ICPPTemplateTemplateParameter)rbinding).getTemplateParameters());
+ return TemplateInstanceUtil.convert(cf, ((ICPPTemplateTemplateParameter) rbinding).getTemplateParameters());
}
@Override
@@ -180,4 +180,9 @@ public class CompositeCPPTemplateTemplateParameter extends CompositeCPPBinding
public ICPPDeferredClassInstance asDeferredInstance() {
return null;
}
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUnknownClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUnknownClassType.java
index ca5ff93..0cb0849 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUnknownClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUnknownClassType.java
@@ -1,13 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 Google, Inc and others.
+ * Copyright (c) 2008, 2012 Google, Inc 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Sergey Prigogin (Google) - initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * Sergey Prigogin (Google) - initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
@@ -140,4 +141,9 @@ class CompositeCPPUnknownClassType extends CompositeCPPUnknownBinding implements
public boolean isAnonymous() {
return false;
}
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMASTAdapter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMASTAdapter.java
index 1332659..d320ede 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMASTAdapter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMASTAdapter.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom;
@@ -615,6 +616,11 @@ public class PDOMASTAdapter {
public boolean isAnonymous() {
return ((ICPPClassType) fDelegate).isAnonymous();
}
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPAnnotation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPAnnotation.java
index 40dde06..2187141 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPAnnotation.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation.
+ * Copyright (c) 2006, 2012 IBM Corporation.
* 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:
* IBM Corporation - initial API and implementation
* Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -38,7 +39,9 @@ class PDOMCPPAnnotation {
public static final int IMPLICIT_METHOD_OFFSET = 2;
public static final int EXPLICIT_METHOD_OFFSET = 3;
public static final int PURE_VIRTUAL_OFFSET = 4;
- public static final int MAX_EXTRA_OFFSET= PURE_VIRTUAL_OFFSET;
+ public static final int OVERRIDE_OFFSET = 5;
+ public static final int FINAL_OFFSET = 6;
+ public static final int MAX_EXTRA_OFFSET= FINAL_OFFSET;
/**
* Encodes storage class specifiers and other annotation, including
@@ -92,6 +95,8 @@ class PDOMCPPAnnotation {
modifiers |= (method.isImplicit() ? 1 : 0) << IMPLICIT_METHOD_OFFSET;
modifiers |= (method.isPureVirtual() ? 1 : 0) << PURE_VIRTUAL_OFFSET;
modifiers |= (method.isExplicit() ? 1 : 0) << EXPLICIT_METHOD_OFFSET;
+ modifiers |= (method.isOverride() ? 1 : 0) << OVERRIDE_OFFSET;
+ modifiers |= (method.isFinal() ? 1 : 0) << FINAL_OFFSET;
}
return modifiers;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java
index 35b992c..82e2b9f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java
@@ -10,6 +10,7 @@
* Andrew Ferguson (Symbian)
* Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -57,12 +58,13 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
ICPPClassSpecialization, IPDOMMemberOwner, IPDOMCPPClassType {
private static final int FIRST_BASE = PDOMCPPSpecialization.RECORD_SIZE + 0;
private static final int MEMBER_LIST = PDOMCPPSpecialization.RECORD_SIZE + 4;
+ private static final int FINAL = PDOMCPPSpecialization.RECORD_SIZE + 8; // byte
/**
* The size in bytes of a PDOMCPPClassSpecialization record in the database.
*/
@SuppressWarnings("hiding")
- protected static final int RECORD_SIZE = PDOMCPPSpecialization.RECORD_SIZE + 8;
+ protected static final int RECORD_SIZE = PDOMCPPSpecialization.RECORD_SIZE + 9;
private volatile ICPPClassScope fScope;
private ObjectMap specializationMap; // Obtained from the synchronized PDOM cache
@@ -71,6 +73,7 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
public PDOMCPPClassSpecialization(PDOMLinkage linkage, PDOMNode parent, ICPPClassType classType,
PDOMBinding specialized) throws CoreException {
super(linkage, parent, (ICPPSpecialization) classType, specialized);
+ setFinal(classType);
}
public PDOMCPPClassSpecialization(PDOMLinkage linkage, long bindingRecord) {
@@ -78,6 +81,15 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
}
@Override
+ public void update(PDOMLinkage linkage, IBinding newBinding) throws CoreException {
+ if (newBinding instanceof ICPPClassType) {
+ ICPPClassType ct= (ICPPClassType) newBinding;
+ setFinal(ct);
+ super.update(linkage, newBinding);
+ }
+ }
+
+ @Override
protected int getRecordSize() {
return RECORD_SIZE;
}
@@ -435,4 +447,18 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
public boolean isAnonymous() {
return false;
}
+
+ @Override
+ public boolean isFinal() {
+ try {
+ return getDB().getByte(record + FINAL) != 0;
+ } catch (CoreException e){
+ CCorePlugin.log(e);
+ return false;
+ }
+ }
+
+ private void setFinal(ICPPClassType ct) throws CoreException {
+ getDB().putByte(record + FINAL, (byte) (ct.isFinal() ? 1 : 0));
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java
index 1ebf474..c62e295 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 QNX Software Systems and others.
+ * Copyright (c) 2005, 2012 QNX Software Systems 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
@@ -11,6 +11,7 @@
* Andrew Ferguson (Symbian)
* Bryan Wilkinson (QNX)
* Sergey Prigogin (Google)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -52,8 +53,9 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
private static final int FIRSTFRIEND = PDOMCPPBinding.RECORD_SIZE + 8;
private static final int KEY = PDOMCPPBinding.RECORD_SIZE + 12; // byte
private static final int ANONYMOUS= PDOMCPPBinding.RECORD_SIZE + 13; // byte
+ private static final int FINAL = PDOMCPPBinding.RECORD_SIZE + 14; // byte
@SuppressWarnings("hiding")
- protected static final int RECORD_SIZE = PDOMCPPBinding.RECORD_SIZE + 14;
+ protected static final int RECORD_SIZE = PDOMCPPBinding.RECORD_SIZE + 15;
private PDOMCPPClassScope fScope; // No need for volatile, all fields of PDOMCPPClassScope are final.
@@ -62,6 +64,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
setKind(classType);
setAnonymous(classType);
+ setFinal(classType);
// linked list is initialized by storage being zero'd by malloc
}
@@ -85,6 +88,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
ICPPClassType ct= (ICPPClassType) newBinding;
setKind(ct);
setAnonymous(ct);
+ setFinal(ct);
super.update(linkage, newBinding);
}
}
@@ -97,6 +101,10 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
getDB().putByte(record + ANONYMOUS, (byte) (ct.isAnonymous() ? 1 : 0));
}
+ private void setFinal(ICPPClassType ct) throws CoreException {
+ getDB().putByte(record + FINAL, (byte) (ct.isFinal() ? 1 : 0));
+ }
+
@Override
public boolean mayHaveChildren() {
return true;
@@ -232,6 +240,16 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
}
@Override
+ public boolean isFinal() {
+ try {
+ return getDB().getByte(record + FINAL) != 0;
+ } catch (CoreException e){
+ CCorePlugin.log(e);
+ return false;
+ }
+ }
+
+ @Override
public boolean isSameType(IType type) {
if (type instanceof ITypedef) {
return type.isSameType(this);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPDeferredClassInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPDeferredClassInstance.java
index 67d65e7..e64d8f9 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPDeferredClassInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPDeferredClassInstance.java
@@ -1,13 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 QNX Software Systems and others.
+ * Copyright (c) 2007, 2012 QNX Software Systems 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Bryan Wilkinson (QNX) - Initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * Bryan Wilkinson (QNX) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -212,6 +213,11 @@ class PDOMCPPDeferredClassInstance extends PDOMCPPSpecialization
}
@Override
+ public boolean isFinal() {
+ return getClassTemplate().isFinal();
+ }
+
+ @Override
public ICPPTemplateArgument[] getTemplateArguments() {
try {
final long rec= getPDOM().getDB().getRecPtr(record+ARGUMENTS);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java
index 7360c7a..697fcfd 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java
@@ -1,15 +1,16 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 QNX Software Systems and others.
+ * Copyright (c) 2006, 2012 QNX Software Systems 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Doug Schaefer (QNX) - Initial API and implementation
- * IBM Corporation
- * Andrew Ferguson (Symbian)
- * Markus Schorn (Wind River Systems)
+ * Doug Schaefer (QNX) - Initial API and implementation
+ * IBM Corporation
+ * Andrew Ferguson (Symbian)
+ * Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -257,4 +258,14 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod {
}
return super.getExceptionSpecification();
}
+
+ @Override
+ public boolean isOverride() {
+ return getBit(getAnnotation1(), PDOMCPPAnnotation.OVERRIDE_OFFSET);
+ }
+
+ @Override
+ public boolean isFinal() {
+ return getBit(getAnnotation1(), PDOMCPPAnnotation.FINAL_OFFSET);
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodInstance.java
index 4fb803f..a54785d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodInstance.java
@@ -1,13 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 QNX Software Systems and others.
+ * Copyright (c) 2007, 2012 QNX Software Systems 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * QNX - Initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * QNX - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -21,10 +22,8 @@ import org.eclipse.core.runtime.CoreException;
/**
* @author Bryan Wilkinson
- *
*/
class PDOMCPPMethodInstance extends PDOMCPPFunctionInstance implements ICPPMethod {
-
/**
* The size in bytes of a PDOMCPPMethodInstance record in the database.
*/
@@ -52,7 +51,7 @@ class PDOMCPPMethodInstance extends PDOMCPPFunctionInstance implements ICPPMetho
@Override
public boolean isDestructor() {
- return ((ICPPMethod)getTemplateDefinition()).isDestructor();
+ return ((ICPPMethod) getTemplateDefinition()).isDestructor();
}
@Override
@@ -62,22 +61,22 @@ class PDOMCPPMethodInstance extends PDOMCPPFunctionInstance implements ICPPMetho
@Override
public boolean isImplicit() {
- return ((ICPPMethod)getTemplateDefinition()).isImplicit();
+ return ((ICPPMethod) getTemplateDefinition()).isImplicit();
}
@Override
public boolean isVirtual() {
- return ((ICPPMethod)getTemplateDefinition()).isVirtual();
+ return ((ICPPMethod) getTemplateDefinition()).isVirtual();
}
@Override
public boolean isPureVirtual() {
- return ((ICPPMethod)getTemplateDefinition()).isPureVirtual();
+ return ((ICPPMethod) getTemplateDefinition()).isPureVirtual();
}
@Override
public boolean isExplicit() {
- return ((ICPPMethod)getTemplateDefinition()).isExplicit();
+ return ((ICPPMethod) getTemplateDefinition()).isExplicit();
}
@Override
@@ -87,6 +86,16 @@ class PDOMCPPMethodInstance extends PDOMCPPFunctionInstance implements ICPPMetho
@Override
public int getVisibility() {
- return ((ICPPMethod)getTemplateDefinition()).getVisibility();
+ return ((ICPPMethod) getTemplateDefinition()).getVisibility();
+ }
+
+ @Override
+ public boolean isOverride() {
+ return ((ICPPMethod) getTemplateDefinition()).isOverride();
+ }
+
+ @Override
+ public boolean isFinal() {
+ return ((ICPPMethod) getTemplateDefinition()).isFinal();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodSpecialization.java
index 1de4f84..3262f7a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 QNX Software Systems and others.
+ * Copyright (c) 2007, 2012 QNX Software Systems 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:
* Bryan Wilkinson (QNX) - Initial API and implementation
* Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -142,4 +143,14 @@ class PDOMCPPMethodSpecialization extends PDOMCPPFunctionSpecialization
}
return super.getExceptionSpecification();
}
+
+ @Override
+ public boolean isOverride() {
+ return false;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplate.java
index fc246b5..894c6f9 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplate.java
@@ -1,13 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 QNX Software Systems and others.
+ * Copyright (c) 2007, 2012 QNX Software Systems 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Bryan Wilkinson (QNX) - Initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * Bryan Wilkinson (QNX) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -150,4 +151,14 @@ class PDOMCPPMethodTemplate extends PDOMCPPFunctionTemplate implements ICPPMetho
public boolean isPureVirtual() {
return false;
}
+
+ @Override
+ public boolean isOverride() {
+ return false;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplateSpecialization.java
index ba697af..c8ced8f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplateSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplateSpecialization.java
@@ -1,13 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 QNX Software Systems and others.
+ * Copyright (c) 2007, 2012 QNX Software Systems 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * QNX - Initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * QNX - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -101,4 +102,14 @@ class PDOMCPPMethodTemplateSpecialization extends
public boolean isPureVirtual() {
return false;
}
+
+ @Override
+ public boolean isOverride() {
+ return false;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTemplateTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTemplateTemplateParameter.java
index db0a22f..5d01179 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTemplateTemplateParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTemplateTemplateParameter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 Wind River Systems, Inc. and others.
+ * Copyright (c) 2008, 2012 Wind River Systems, Inc. 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -340,6 +341,11 @@ public class PDOMCPPTemplateTemplateParameter extends PDOMCPPBinding
}
@Override
+ public boolean isFinal() {
+ return false;
+ }
+
+ @Override
public ICPPTemplateParameter adaptTemplateParameter(ICPPTemplateParameter param) {
int pos = param.getParameterPosition();
ICPPTemplateParameter[] pars = getTemplateParameters();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassType.java
index b6e6893..5fc6fbb 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 Google, Inc and others.
+ * Copyright (c) 2008, 2012 Google, Inc 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:
* Sergey Prigogin (Google) - initial API and implementation
* Markus Schorn (Wind River Systems)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -285,4 +286,9 @@ class PDOMCPPUnknownClassType extends PDOMCPPUnknownBinding
public boolean isAnonymous() {
return false;
}
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
}