Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 100641 - Binary bitwise & expression parsed as Cast Expression
Summary: Binary bitwise & expression parsed as Cast Expression
Status: RESOLVED DUPLICATE of bug 168924
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-17 14:50 EDT by Andrew Niefer CLA
Modified: 2008-02-13 08:36 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Niefer CLA 2005-06-17 14:50:48 EDT
void isTrue( int field, int bit ){
   return ( (field) & (bit) );
}

The (field) & (bit) is being parsed as a cast expression instead of as a binary
expression.

This was found in the DOTL project (http://sourceforge.net/projects/dotl/) where
it takes the form of a macro 
#define IS_SET(flag,bit)  ((flag) & (bit))
Comment 1 John Camelon CLA 2005-06-20 10:56:29 EDT
This is an ambiguity. 
If field was a type rather than an parm passed in, it could even be valid.
Comment 2 Doug Schaefer CLA 2007-08-21 10:59:49 EDT
Future means you commit to fix it in the Future. Inboxes can't make committments. Moving to '--'.
Comment 3 Markus Schorn CLA 2008-02-13 08:36:48 EST
Created testcase AST2Tests.testBug100641_106279_castAmbiguity().
Fixed with bug 168924.

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