mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 00:45:28 +02:00
Bug 380623 - [C++11] Explicit Virtual Overrides
This commit is contained in:
parent
cce375dd68
commit
6d4c1e4dff
51 changed files with 971 additions and 171 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,3 +32,6 @@ class D {
|
|||
public:
|
||||
D(D &) {}
|
||||
};
|
||||
|
||||
class E final : public A {
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
{
|
||||
};
|
||||
|
|
|
@ -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
|
||||
{
|
||||
}
|
||||
};
|
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -187,6 +188,16 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOverride() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinal() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinding getOwner() {
|
||||
return getClassOwner();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -105,6 +106,16 @@ public class CPPMethodSpecialization extends CPPFunctionSpecialization implement
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOverride() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinal() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IType[] getExceptionSpecification(IASTNode point) {
|
||||
if (isImplicit()) {
|
||||
|
|
|
@ -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() {
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
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) {
|
||||
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 null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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,12 +73,22 @@ 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) {
|
||||
super(linkage, bindingRecord);
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -231,6 +239,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) {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -211,6 +212,11 @@ class PDOMCPPDeferredClassInstance extends PDOMCPPSpecialization
|
|||
return (ICPPTemplateDefinition) getSpecializedBinding();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinal() {
|
||||
return getClassTemplate().isFinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICPPTemplateArgument[] getTemplateArguments() {
|
||||
try {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -339,6 +340,11 @@ public class PDOMCPPTemplateTemplateParameter extends PDOMCPPBinding
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinal() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICPPTemplateParameter adaptTemplateParameter(ICPPTemplateParameter param) {
|
||||
int pos = param.getParameterPosition();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue