summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-08-25 20:40:28 (EDT)
committerSergey Prigogin2013-08-26 16:34:41 (EDT)
commit404b6d728364041407b2b6cdb8f0ae9092cc828a (patch)
tree4a86620b1e61292d5d699f595a18ffb0fc066e20
parent7fc4c9b937c5ffef9c17673a8cabc0953ee00f01 (diff)
downloadorg.eclipse.cdt-404b6d728364041407b2b6cdb8f0ae9092cc828a.zip
org.eclipse.cdt-404b6d728364041407b2b6cdb8f0ae9092cc828a.tar.gz
org.eclipse.cdt-404b6d728364041407b2b6cdb8f0ae9092cc828a.tar.bz2
Bug 400204 - Unexpected syntax error in C struct declarationrefs/changes/38/15838/2
Change-Id: Idc8450517362e6f6d9f00c9dfc13034d6de456a2 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com> Reviewed-on: https://git.eclipse.org/r/15838 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/GCCCompleteParseExtensionsTest.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java2
2 files changed, 9 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/GCCCompleteParseExtensionsTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/GCCCompleteParseExtensionsTest.java
index 803f458..1e28157 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/GCCCompleteParseExtensionsTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/GCCCompleteParseExtensionsTest.java
@@ -432,4 +432,12 @@ public class GCCCompleteParseExtensionsTest extends AST2TestBase {
parseGCC(code);
parseGPP(code);
}
+
+ // struct waldo {
+ // } __attribute__((__aligned__((1))));
+ public void test__attribute__aligned_bug400204() throws Exception {
+ String code= getAboveComment();
+ parseGCC(code);
+ parseGPP(code);
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java
index 05511bf..2b0793b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java
@@ -2413,7 +2413,7 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
while ((t = LA(1)).getType() != endType) {
consume();
IASTToken token;
- switch (LT(1)) {
+ switch (t.getType()) {
case IToken.tLPAREN:
token = balancedTokenSeq(t.getOffset(), IToken.tRPAREN);
break;