summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-08-25 20:40:28 (EDT)
committer Sergey Prigogin2013-08-26 16:45:21 (EDT)
commit5cb56f98bc0084b20e633a235d736d5f3175bd96 (patch)
treee389269fce817b6abb2b3d646c7597ad18b40982
parent94cd95541548411321c336b9651e0ace129d07e9 (diff)
downloadorg.eclipse.cdt-5cb56f98bc0084b20e633a235d736d5f3175bd96.zip
org.eclipse.cdt-5cb56f98bc0084b20e633a235d736d5f3175bd96.tar.gz
org.eclipse.cdt-5cb56f98bc0084b20e633a235d736d5f3175bd96.tar.bz2
Bug 400204 - Unexpected syntax error in C struct declaration
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;