Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370637 - When using the AST, leaving a while statement is not notified
Summary: When using the AST, leaving a while statement is not notified
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 8.1.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-04 10:36 EST by Gil Barash CLA
Modified: 2013-02-27 11:38 EST (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 Gil Barash CLA 2012-02-04 10:36:37 EST
Build Identifier: Ecliupse 3.7.1 - CDT 8.0.0.201106081058

I built a AST visitor, enabling only "shouldVisitStatements".
The "public int visit(IASTStatement statement)" is called for "while statements", but the "public int leave(IASTStatement statement)" is not called.

This happens only in C++ code (not C).

I believe the problem is caused by a typo in the "CPPASTWhileStatement" class, in the function "accept(ASTVisitor action)" (line 117, in my source version). It states "if (action.shouldVisitExpressions)" instead of "if (action.shouldVisitStatements)".




Reproducible: Always
Comment 1 Markus Schorn CLA 2012-04-04 02:30:28 EDT
Thanks!
Comment 2 CDT Genie CLA 2013-02-27 11:38:48 EST
*** cdt git genie on behalf of Markus Schorn ***

    Bug 370637: Visiting while statements.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=105de6f15d2ff84d16616098e43ed76ba93d1ef5