diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java index ce0adf4f27f..ad6089ffa2a 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java @@ -491,4 +491,12 @@ public class AST2CPPAttributeTests extends AST2TestBase { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, true); checkAttributeRelations(getAttributeSpecifiers(tu), IASTDeclarator.class); } + + // struct S { + // void foo() override __attribute__((attr)); + // }; + public void testGCCAttributeAfterOverride_bug413615() throws Exception { + IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, true); + checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTFunctionDeclarator.class); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java index 261c5d36828..d098371ce4a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java @@ -3559,6 +3559,8 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser { // For member functions we need to consider virtual specifiers and pure-virtual syntax. if (option == DeclarationOptions.CPP_MEMBER) { optionalVirtSpecifierSeq((ICPPASTFunctionDeclarator) typeRelevantDtor); + List attributeSpecifiers = __attribute_decl_seq(supportAttributeSpecifiers, false); + addAttributeSpecifiers(attributeSpecifiers, dtor); int lt1 = LTcatchEOF(1); if (lt1 == IToken.tASSIGN && LTcatchEOF(2) == IToken.tINTEGER) { consume();