Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349534 - IASTPreprocessorStatement contained in inactive code block claims to be active
Summary: IASTPreprocessorStatement contained in inactive code block claims to be active
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: 8.1.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
: 378479 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-16 04:49 EDT by Lukas Felber CLA
Modified: 2012-05-04 09:29 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Felber CLA 2011-06-16 04:49:25 EDT
Build Identifier: M20100909-0800

When calling isActive on an AST node representing a preprocessor statement which is located inside of an inactive code segment, the result is true. Which is, as I see it, wrong.


Reproducible: Always

Steps to Reproduce:
1. create source file containing following code:
#ifdef A //this one is active (which is correct)
	#ifdef B //this one claims to be active too (which seems wrong to me
	#endif
#endif
2. call translationUnit.getAllPreprocessorStatements()[1].isActive()
Comment 1 Markus Schorn CLA 2011-06-16 05:44:03 EDT
It looks like the preprocessor does not mark most of the preprocessing statements as inactive. It does so for includes and macro definitions, though.
Comment 2 Markus Schorn CLA 2011-07-04 10:04:57 EDT
Added testcase, fixed in 8.1 > 20110704.
Comment 3 Markus Schorn CLA 2012-05-04 09:29:54 EDT
*** Bug 378479 has been marked as a duplicate of this bug. ***