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

Bug 349534

Summary: IASTPreprocessorStatement contained in inactive code block claims to be active
Product: [Tools] CDT Reporter: Lukas Felber <l.felber>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: minor    
Priority: P3 CC: cdtdoug, waste.manager, yevshif
Version: 8.0   
Target Milestone: 8.1.0   
Hardware: PC   
OS: Linux   
Whiteboard:

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. ***