diff options
author | Marc-Andre Laperle | 2018-09-22 03:44:23 +0000 |
---|---|---|
committer | Marc-André Laperle | 2018-09-26 23:24:36 +0000 |
commit | 70a03a862e263385e253d11699859d1c5dab7895 (patch) | |
tree | 362c860beb7496e3460adc4cc60102739954c973 /core/org.eclipse.cdt.core | |
parent | c6abbfb6d31f673c7238a1d5a504d515031083ae (diff) | |
download | org.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')
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); + } + } } } |