Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2018-09-22 03:44:23 +0000
committerMarc-André Laperle2018-09-26 23:24:36 +0000
commit70a03a862e263385e253d11699859d1c5dab7895 (patch)
tree362c860beb7496e3460adc4cc60102739954c973 /core/org.eclipse.cdt.core
parentc6abbfb6d31f673c7238a1d5a504d515031083ae (diff)
downloadorg.eclipse.cdt-70a03a862e263385e253d11699859d1c5dab7895.tar.gz
org.eclipse.cdt-70a03a862e263385e253d11699859d1c5dab7895.tar.xz
org.eclipse.cdt-70a03a862e263385e253d11699859d1c5dab7895.zip
Bug 518273 - Toggle function should remove the override keyword when moving out of class
Change-Id: I7ad80262c7f9b98d3ae9b23ae2b45bf0c94ccf99 Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTFunctionDeclarator.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java28
2 files changed, 27 insertions, 7 deletions
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 f167de18372..b7d34d8ee44 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
@@ -213,6 +213,12 @@ public interface ICPPASTFunctionDeclarator extends IASTStandardFunctionDeclarato
public void addVirtSpecifier(ICPPASTVirtSpecifier virtSpecifier);
/**
+ * Set virt-specifiers of this function.
+ * @since 6.6
+ */
+ public void setVirtSpecifiers(ICPPASTVirtSpecifier[] newVirtSpecifiers);
+
+ /**
* @deprecated Not used.
* @noreference This field is not intended to be referenced by clients.
*/
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 0aa2b78e943..7c4fd31fa22 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
@@ -362,12 +362,26 @@ public class CPPASTFunctionDeclarator extends CPPASTDeclarator implements ICPPAS
@Override
public void addVirtSpecifier(ICPPASTVirtSpecifier virtSpecifier) {
- assertNotFrozen();
- if (virtSpecifier != null) {
- assert virtSpecifiers != null;
- virtSpecifiers = ArrayUtil.append(virtSpecifiers, virtSpecifier);
- virtSpecifier.setParent(this);
- virtSpecifier.setPropertyInParent(EXCEPTION_TYPEID);
- }
+ assertNotFrozen();
+ if (virtSpecifier != null) {
+ assert virtSpecifiers != null;
+ virtSpecifiers = ArrayUtil.append(virtSpecifiers, virtSpecifier);
+ virtSpecifier.setParent(this);
+ virtSpecifier.setPropertyInParent(VIRT_SPECIFIER);
+ }
+ }
+
+ @Override
+ public void setVirtSpecifiers(ICPPASTVirtSpecifier[] newVirtSpecifiers) {
+ assertNotFrozen();
+ if (newVirtSpecifiers == null) {
+ virtSpecifiers = NO_VIRT_SPECIFIERS;
+ } else {
+ virtSpecifiers = newVirtSpecifiers;
+ for (ICPPASTVirtSpecifier virtSpecifier : newVirtSpecifiers) {
+ virtSpecifier.setParent(this);
+ virtSpecifier.setPropertyInParent(VIRT_SPECIFIER);
+ }
+ }
}
}

Back to the top