Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjyou13y2015-06-17 05:39:14 +0000
committerGerrit Code Review @ Eclipse.org2015-06-18 07:03:56 +0000
commit6e7a509f9b7325ee070c47754cae46de91fa9c5b (patch)
tree6ef63ef28d752d0eba501933325929ddfd439b2b
parent4ac73d7e0c5a6cb375459930ae4e3774f38ac70c (diff)
downloadorg.eclipse.cdt-6e7a509f9b7325ee070c47754cae46de91fa9c5b.tar.gz
org.eclipse.cdt-6e7a509f9b7325ee070c47754cae46de91fa9c5b.tar.xz
org.eclipse.cdt-6e7a509f9b7325ee070c47754cae46de91fa9c5b.zip
Bug 84144 [Parser2] GCC: labels as values
add support for syntax int k = (int) && x; Signed-off-by: jyou13y <justin.you@synopsys.com> Change-Id: I3bb888b8930706b01c545794be4e054b025e641f
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java16
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java2
2 files changed, 15 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java
index fdd1a794c17..74f7c14f572 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2014 IBM Corporation and others.
+ * Copyright (c) 2004, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7565,7 +7565,19 @@ public class AST2Tests extends AST2TestBase {
public void testExpressionLabelReference_84144() throws Exception {
parseAndCheckBindings(true);
}
-
+
+ // void f()
+ // {
+ // unsigned long long labelPtr;
+ // labelPtr = (unsigned long long) &&L;
+ // goto *labelPtr;
+ // L:
+ // return;
+ // }
+ public void testExpressionLabelReferenceCast_84144() throws Exception {
+ parseAndCheckBindings(true);
+ }
+
// int version = 0;
// int NextVersion() {
// return __atomic_add_fetch(&version, 1, 5);
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 add2ddf7e9c..a8a4d1a9193 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
@@ -13,6 +13,7 @@
* Sergey Prigogin (Google)
* Thomas Corbat (IFS)
* Anders Dahlberg (Ericsson) - bug 84144
+ * Justin You (Synopsys) - bug 84144
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser;
@@ -2556,7 +2557,6 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
skipBrackets(IToken.tLPAREN, IToken.tRPAREN, IToken.tSEMI);
switch (LTcatchEOF(1)) {
case IToken.tAMPERASSIGN:
- case IToken.tAND:
case IToken.tARROW:
case IToken.tARROWSTAR:
case IToken.tASSIGN:

Back to the top