Bug 564331 - commentMap is empty for Enumerators
Summary: commentMap is empty for Enumerators
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 9.10.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-16 07:15 EDT by Robin Herrmann CLA
Modified: 2020-06-16 09:34 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Herrmann CLA 2020-06-16 07:15:36 EDT
The ASTCommentVisitor does not visit Enumerators. Thereby, the commentMap does not include IASTComments for Enumerators, e.g.:

typedef enum {
 A, // missing in trailingMap (NodeCommentMap)
 // missing in leadingMap (NodeCommentMap)
 B
} enum_t;

There is a leave function, but no visit function for IASTEnumerator. Furthermore, shouldVisitEnumerators is not set.
Comment 1 Jonah Graham CLA 2020-06-16 09:34:30 EDT
Hi Robin,

Thanks for your analysis. It sounds like you have a good handle on this problem. Will you be able to provide a fix? Please let me know how I can help you create a gerrit for review.

Thanks,
Jonah