Bug 295851 - IEnumerator.getValue() returns null if the value is defined by a conditional expression
Summary: IEnumerator.getValue() returns null if the value is defined by a conditional ...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 6.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 6.0.2   Edit
Assignee: Project Inbox CLA
QA Contact: Mike Kucera CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2009-11-23 07:09 EST by Richard Miskin CLA
Modified: 2009-11-24 13:29 EST (History)
0 users

See Also:


Attachments
Fix and test case (5.13 KB, patch)
2009-11-23 07:14 EST, Richard Miskin CLA
mschorn.eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Miskin CLA 2009-11-23 07:09:34 EST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
Build Identifier: M20090917-0800

For the following enumeration type the value on the enumerator _ISalnum is always null.

enum
{
  _ISalnum = 11 < 8 ? 1 : 2
};

The problem is that the code to handle IASTConditionalExpression in Value tests for Long but an Integer is returned by evaluate(). Changing this to test for Number solves the problem.

I'll attach a patch and a test case.



Reproducible: Always
Comment 1 Richard Miskin CLA 2009-11-23 07:14:18 EST
Created attachment 152845 [details]
Fix and test case
Comment 2 Markus Schorn CLA 2009-11-24 13:29:08 EST
Thanks Richard!

Fixed in 6.0.2 and 6.1 > 20091124.