From 6e7a509f9b7325ee070c47754cae46de91fa9c5b Mon Sep 17 00:00:00 2001 From: jyou13y Date: Wed, 17 Jun 2015 13:39:14 +0800 Subject: [PATCH] Bug 84144 [Parser2] GCC: labels as values add support for syntax int k = (int) && x; Signed-off-by: jyou13y Change-Id: I3bb888b8930706b01c545794be4e054b025e641f --- .../cdt/core/parser/tests/ast2/AST2Tests.java | 16 ++++++++++++++-- .../dom/parser/AbstractGNUSourceCodeParser.java | 2 +- 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: