Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2019-06-29 06:44:22 +0000
committerNathan Ridge2019-06-29 06:44:22 +0000
commit451fa86e3557e8be5617f85d7a980c7fb0a53ce7 (patch)
treec4fc32f2ca35245813e59d66c7612ce05fc0c486 /core/org.eclipse.cdt.core/parser/org
parent996d7193c045c75c7cb4ec7b4482f24a116de75b (diff)
downloadorg.eclipse.cdt-451fa86e3557e8be5617f85d7a980c7fb0a53ce7.tar.gz
org.eclipse.cdt-451fa86e3557e8be5617f85d7a980c7fb0a53ce7.tar.xz
org.eclipse.cdt-451fa86e3557e8be5617f85d7a980c7fb0a53ce7.zip
Bug 467346 - Retain attribute after struct key in C
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java
index 78e0b3ebf80..88e1f9afc7a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java
@@ -1311,7 +1311,8 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
}
// if __attribute__ or __declspec occurs after struct/union/class and before the identifier
- __attribute_decl_seq(supportAttributeSpecifiers, supportDeclspecSpecifiers);
+ List<IASTAttributeSpecifier> attributes = __attribute_decl_seq(supportAttributeSpecifiers,
+ supportDeclspecSpecifiers);
// class name
IASTName name = null;
@@ -1320,7 +1321,8 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
}
// if __attribute__ or __declspec occurs after struct/union/class identifier and before the { or ;
- __attribute_decl_seq(supportAttributeSpecifiers, supportDeclspecSpecifiers);
+ attributes = CollectionUtils.merge(attributes,
+ __attribute_decl_seq(supportAttributeSpecifiers, supportDeclspecSpecifiers));
if (LT(1) != IToken.tLBRACE) {
IToken errorPoint = LA(1);
@@ -1333,6 +1335,7 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
}
ICASTCompositeTypeSpecifier result = getNodeFactory().newCompositeTypeSpecifier(classKind, name);
declarationListInBraces(result, offset, DeclarationOptions.C_MEMBER);
+ addAttributeSpecifiers(attributes, result);
return result;
}

Back to the top