Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316673

Summary: Parser thinks getting labels as values is a syntax error
Product: [Tools] CDT Reporter: Stephen Pape <srpape>
Component: cdt-parserAssignee: Project Inbox <cdt-parser-inbox>
Status: CLOSED DUPLICATE QA Contact: Mike Kucera <mikekucera>
Severity: normal    
Priority: P3    
Version: 7.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Stephen Pape CLA 2010-06-12 01:24:24 EDT
Build Identifier: 20100218-1602

GCC allows you to get the address of a label using the && operator.

Example Code
--------------
somelabel:
	void* ptr;
	ptr = &&somelabel;
--------------

Eclipse underlines the line containing && in yellow and claims it's a syntax error, though the code compiles fine.

More information can be found here: http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html

Reproducible: Always

Steps to Reproduce:
1.Create a C/C++ project and source file
2.Use a label
3.Attempt to get the address of the label
Comment 1 Markus Schorn CLA 2010-06-14 03:11:26 EDT

*** This bug has been marked as a duplicate of bug 84144 ***